-
-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fatal: --local can only be used inside a git repository
error on containers
#1170
fatal: --local can only be used inside a git repository
error on containers
#1170
Comments
Hi @eitsupi Thank you for bringing this to my attention. I've confirmed that the workaround provided in that issue works with this action. If you run into this issue, please use the workaround as follows. - uses: actions/checkout@v3
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
# Make changes to pull request here
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4 I will work on a fix for this issue soon. |
I am still having this issue, is it not fixed? :( |
Unfortunately the |
getting the same issue with the following output:
|
well I'm happy to report that I made some changes to my action and fixed this error. I was using this action as part of a multi action workflow and had placed the
This resulted in the Moving the
hope this maybe helps someone else out |
I am running into the same issue. I've tried to add Any other tip on how to overcome this ? |
For those running into this error and finding this issue, as far as I'm aware, the workaround I posted is the only way to resolve it. If you cannot get your workflow to work with the workaround, then there is probably something you are doing wrong in the workflow. The official checkout action has "fixed" this issue, but they have done it in a way where the fix doesn't persist to later workflow steps. You can see the fix here: actions/checkout#762
They also acknowledge that this is an ecosystem level problem and should probably be solved there somehow. I've haven't attempted to implement a similar fix to checkout because I was hoping they would fix it at the ecosystem level. To be clear, the "fix" that checkout have made to their action is the same as the workaround. They just do it for you inside the action and remove the config again at the end. I might implement a similar fix at some point, just to make the workaround step unnecessary, but it's not high priority. |
I've created a fix for this which adds the I'm planning to release this in the near future as part of a new major version. I would really appreciate testing/feedback for this fix. Feel free to use - uses: peter-evans/create-pull-request@v5-beta |
We are still experiencing issues using v5-beta, getting the same error:
This is our workflow: name: Scheduled production release
on:
schedule:
- cron: "0 0 * * 3"
jobs:
auto-pull-request:
name: Create release PR to master
runs-on: ubuntu-latest
steps:
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5-beta
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: "Weekly production release"
body: "Weekly release"
branch: "dev"
base: "master"
labels: "ignore-semantic" Any tips? |
@Xtrah There are a couple of things wrong with your workflow. Firstly, you don't have any checkout step. Secondly, it looks like you are trying to use an existing branch for the |
@peter-evans try to use your workaround, there is a security violation to use your create-pull-request |
This is now fixed in If you are using |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) | action | major | `v4.2.4` -> `v5.0.2` | --- ### Release Notes <details> <summary>peter-evans/create-pull-request</summary> ### [`v5.0.2`](https://github.com/peter-evans/create-pull-request/releases/tag/v5.0.2): Create Pull Request v5.0.2 [Compare Source](https://github.com/peter-evans/create-pull-request/compare/v5.0.1...v5.0.2) ⚙️ Fixes an issue that occurs when using `push-to-fork` and both base and head repositories are in the same org/user account. #### What's Changed - fix: specify head repo by [@​peter-evans](https://github.com/peter-evans) in [peter-evans/create-pull-request#2044 - 20 dependency updates by [@​dependabot](https://github.com/dependabot) **Full Changelog**: peter-evans/create-pull-request@v5.0.1...v5.0.2 ### [`v5.0.1`](https://github.com/peter-evans/create-pull-request/releases/tag/v5.0.1): Create Pull Request v5.0.1 [Compare Source](https://github.com/peter-evans/create-pull-request/compare/v5.0.0...v5.0.1) ##### What's Changed - fix: truncate body if exceeds max length by [@​peter-evans](https://github.com/peter-evans) in [peter-evans/create-pull-request#1915 - 12 dependency updates by [@​dependabot](https://github.com/dependabot) **Full Changelog**: peter-evans/create-pull-request@v5.0.0...v5.0.1 ### [`v5.0.0`](https://github.com/peter-evans/create-pull-request/releases/tag/v5.0.0): Create Pull Request v5.0.0 [Compare Source](https://github.com/peter-evans/create-pull-request/compare/v4.2.4...v5.0.0) ##### Behaviour changes - The action will no longer leave the local repository checked out on the pull request `branch`. Instead, it will leave the repository checked out on the branch or commit that it was when the action started. - When using `add-paths`, uncommitted changes will no longer be destroyed. They will be stashed and restored at the end of the action run. ##### What's new - Adds input `body-path`, the path to a file containing the pull request body. - At the end of the action run the local repository is now checked out on the branch or commit that it was when the action started. - Any uncommitted tracked or untracked changes are now stashed and restored at the end of the action run. Currently, this can only occur when using the `add-paths` input, which allows for changes to not be committed. Previously, any uncommitted changes would be destroyed. - The proxy implementation has been revised but is not expected to have any change in behaviour. It continues to support the standard environment variables `http_proxy`, `https_proxy` and `no_proxy`. - Now sets the git `safe.directory` configuration for the local repository path. The configuration is removed when the action completes. Fixes issue [peter-evans/create-pull-request#1170. - Now determines the git directory path using the `git rev-parse --git-dir` command. This allows users with custom repository configurations to use the action. - Improved handling of the `team-reviewers` input and associated errors. ##### News :trophy: create-pull-request won [an award](https://twitter.com/peterevans0/status/1638463617686470657?s=20) for "awesome action" at the Open Source Awards at GitHub Universe. Thank you for your support and for making create-pull-request one of the top used actions. Please give it a ⭐, or even [buy me a coffee](https://github.com/sponsors/peter-evans). ##### What's Changed - v5 by [@​peter-evans](https://github.com/peter-evans) in [peter-evans/create-pull-request#1792 - 15 dependency updates by [@​dependabot](https://github.com/dependabot) **Full Changelog**: peter-evans/create-pull-request@v4.2.4...v5.0.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/levaintech/keychain). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMzEuMCIsInVwZGF0ZWRJblZlciI6IjM1LjEzMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Subject of the issue
Maybe related to actions/checkout#760.
This action seems to fail on containers using the latest version of Git.
The checkout action had a fix for this yesterday, but I believe other actions like this one continue to be affected.
Steps to reproduce
Use this action on containers like
ubuntu:focal
.The text was updated successfully, but these errors were encountered: