image-actions
image-actions copied to clipboard
[Bug] Fails on a reopened PR
Describe the bug
When a PR is closed and then reopened, the action job fails with Error: Check run has action reopened . Wants: synchronize or opened
How To Reproduce
Steps to reproduce the behavior:
- Open a PR
- Wait for a job to finish
- Close the PR and then reopen it
- Job fails. See error
Expected behaviour
The jobs does not fail (either do not run or run and be skipped)
Additional context
Config:
name: Compress images
on: pull_request
jobs:
build:
name: calibreapp/image-actions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: calibreapp/image-actions
uses: docker://calibreapp/github-image-actions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Relevant code seems to be entrypoint.js#L27
@nathanaelhoun, image actions runs when a pull request is initiated or when a commit is added — just curious why you'd expect it to also when when you've re-opened a closed PR?
@benschwarz In fact, I don't expect it to to run, I expect it to not fail and produce a check failure. I have updated my issue, it was not really exact
Thanks for the clarification @nathanaelhoun.
To confirm, the issue is that it returns an error rather than a no-op?
GitHub must've changed that behaviour. Earlier versions of actions would have exited in this scenario.
Sounds like the update required will be to exit cleanly.
Ref: https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/setting-exit-codes-for-actions
Seems like there isn't a no-op mode any longer. We'll need to exit with a success code.
Thanks for the investigation @benschwarz! Exiting with a success code, rather than with an error code, is perfectly fine 👍