-
-
Notifications
You must be signed in to change notification settings - Fork 441
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
git checkout invalid reference on existing PR #1073
Comments
What you want to do is definitely doable with this action, but I'm a bit confused by the demo implementation.
Just going off this as a description of what you want to do, here is a rough outline of how it should work. # Checkout app-repo to a different path from the default
- uses: actions/checkout@v2
with:
path: app-repo
# Checkout the manifiest repo on the base (target) of the pull request
- uses: actions/checkout@v2
with:
repository: my-org/manifests-repo
ref: main
# Make changes to pull request here
# Copy files from `app-repo` path to here
# Alternatively, use upload-artifact/download-artifact actions to get the files you want copied here
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: (use a PAT here that has write access to the manifests-repo) |
Hi @peter-evans , thanks for getting back to me. I did try and clear up that demo repo and removed a lot of the variables so it should be easier to read now. It essentially mirrors your example above, without using the
It looks like I still get the error even with that. Any ideas what I might be doing wrong? |
I think I figured this one out today. It looks like you can't do a clone with a depth of 1. I didn't dig in too much further, but I would guess it's because But either way, I can close this out. |
Subject of the issue
I'm running into an error using this action in the
Create or update the pull request branch
step:This error only occurs if the action runs more than one time and the pull request is still open.
I originally saw this error on a private repo that is part of a gitops deploy pipeline. In my case, there are two repos: the application repo and the manifests repo. The application repo contains app source code and the manifests repo holds all the Kubernetes yaml files that ArgoCD automatically deploys when it hits the
main
branch.The goal with using this action was to automatically open a pull request on the manifests repo whenever a commit was made to the
main
branch on the app repo. The yaml files would be auto generated in the app repo's workflow, and then a PR would be created on the manifests repo to add/update them. Since I don't necessarily want to deploy all changes immediately when they hit the main branch on the app repo, there may be more commits to that pull request after it's opened. Based on this action's docs:I assumed this would work, but I may be doing something incorrectly.
Steps to reproduce
Because the original repo I saw this error on is private, I've created a repo to demo the error here https://github.com/jault-figure/cpr-demo. The 2nd action run successfully created the pull request (https://github.com/jault-figure/cpr-demo/actions/runs/1900807797). The pull requests is here jault-figure/cpr-target#1
The 3rd action run was triggered by another commit to the app repo, but failed to update the existing pull request (https://github.com/jault-figure/cpr-demo/actions/runs/1900811622)
Just a quick note about this line https://github.com/jault-figure/cpr-demo/blob/main/.github/workflows/build.yaml#L13: In the original private repo where I saw this error, I'm using this
create-pull-request
action as part of a private composite action. Composite actions don't supportpost
steps, so I have to run a clone manually instead of using the checkout action. Although, I think the checkout action does a shallow clone anyways, so I believe it's equivalent.Any help would be appreciated!
The text was updated successfully, but these errors were encountered: