Skip to content
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

Cancellation of previous workflow runs with GH Actions #622

Closed
lars-reimann opened this issue Aug 5, 2021 · 2 comments · Fixed by #751
Closed

Cancellation of previous workflow runs with GH Actions #622

lars-reimann opened this issue Aug 5, 2021 · 2 comments · Fixed by #751
Labels
bug Something isn't working

Comments

@lars-reimann
Copy link
Contributor

Describe the bug
The example workflow for GitHub actions contains the following section:

# Cancel duplicate jobs: https://github.com/fkirc/skip-duplicate-actions#option-3-cancellation-only
cancel_duplicates:
  name: Cancel duplicate jobs
  runs-on: ubuntu-latest
  steps:
    - uses: fkirc/skip-duplicate-actions@master
      with:
        github_token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}

The intention behind this seems to be to cancel previous workflow runs when a push on the same branch occurs. However, the default behavior of fkirc/skip-duplicate-actions was changed in fkirc/skip-duplicate-actions#93 and the section #option-3-cancellation-only mentioned in the comment was subsequently removed in fkirc/skip-duplicate-actions#94. Now it is necessary to specifically set the option cancel_others, otherwise previous workflows run until completion.

cancel_duplicates:
  name: Cancel duplicate jobs
  runs-on: ubuntu-latest
  steps:
    - uses: fkirc/skip-duplicate-actions@master
      with:
        github_token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
        cancel_others: true

It might be advisable to fix this dependency to a specific version (at least major + minor), since they introduce breaking changes with minor version updates.

To Reproduce
Steps to reproduce the behavior:

  1. Use example workflow for GitHub Actions (also created by mega-linter-runner)
  2. Push to trigger workflow
  3. Push again before the previous workflow is done.

Expected behavior
Previous workflow runs should be cancelled when new pushes to the branch occur.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@lars-reimann lars-reimann added the bug Something isn't working label Aug 5, 2021
llaville added a commit to llaville/phpunit-LoggerTestListener that referenced this issue Sep 1, 2021
llaville added a commit to llaville/php-compatinfo-db that referenced this issue Sep 1, 2021
llaville added a commit to llaville/docker-php-toolbox that referenced this issue Sep 1, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2021

This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Sep 5, 2021
@nvuillam
Copy link
Member

nvuillam commented Sep 5, 2021

Not stale, to check

@github-actions github-actions bot removed the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants