-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Checkout fails on pull request closed event #136
Comments
I was able to solve this by using:
Now, I thought |
Updated title |
Master is only the default if it's checking out another repository, I think. Otherwise it defaults to whatever triggered the event. From the README: # The branch, tag or SHA to checkout. When checking out the repository that
# triggered a workflow, this defaults to the reference or SHA for that event.
# Otherwise, defaults to `master`. But the readme also gives this as the recipe for checking out a closed pull request, which seems wrong: on:
pull_request:
branches: [master]
types: [opened, synchronize, closed]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2 @jwnx, I think your workaround is going to run into race conditions if there's another push to master in the meantime. We just run things on push to master, which I think should achieve the same result? Unless you don't want to run if someone pushes straight to master and only for merged pull requests for some reason?
I am experiencing the same error in a slightly different context though (apologies if this should be in a different issue). Our automation force pushes to a PR branch before merging and this triggers another run of the workflow, which fails with that same error message because the PR is already closed (e.g. https://github.com/google/iree/runs/395655503). Could the handling for closed pull requests be better overall? Is there a way to get the action to always check out a valid commit, or abort if the PR has already been closed? (We run the relevant things on pushes to master anyway). |
+1. I think a correct workaround is to use on:
pull_request:
types: [closed]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }} |
Thanks for fixing. The spurious status failures have gone away. |
Hello everyone,
So, I have a
.github/workflow/docker.yml
like this:Which is pretty basic. The goal is to run this on master after a pull request is merged. It does find the lastest commit on master (be3c9f9), as seen here:
But when it comes to checking out, it cant:
We also tried tying it explicitly to master, like this:
But the same problem occurs. Any ideas? (:
cheers
The text was updated successfully, but these errors were encountered: