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

Bump n1hility/cancel-previous-runs from 2 to 3 #307

Merged

Conversation

dependabot[bot]
Copy link

@dependabot dependabot bot commented on behalf of github Mar 7, 2024

⚠️ Dependabot is rebasing this PR ⚠️

Rebasing might not happen immediately, so don't worry if this takes some time.

Note: if you make any changes to this PR yourself, they will take precedence over the rebase.


Bumps n1hility/cancel-previous-runs from 2 to 3.

Release notes

Sourced from n1hility/cancel-previous-runs's releases.

v3.0

cancel-previous-runs

This action cancels previous runs for one or more branches/prs associated with a workflow, effectively limiting the resource consumption of the workflow to one per branch.

Usage

The easiest and most complete approach to utilize this action, is to create a separate schedule event triggered workflow, which is directed at the workflow you wish to clear duplicate runs. At each cron interval all branches and all PRs executing for either push or pull_request events will be processed and limited to one run per branch/pr.

Additionally this action can be placed as an early step in your workflow (e.g. after checkout), so that it can abort the other previously running jobs immediately, in case most resources are tied up. Unfortunately this approach is a no-op when a pull request uses a fork for a source branch. This is because the GITHUB_TOKEN provided to runs with a fork source branch specifies reed-only permissions for security reasons. write permissions are required to be able to cancel a job. Therefore, it's a good idea to only rely on this approach as a fallback in-addition to the previously described scheduling model.

Inputs

token - The github token passed from ${{ secrets.GITHUB_TOKEN }}. Since workflow files are visible in the repository, DO NOT HARDCODE A TOKEN ONLY USE A REFERENCE. workflow - The filename of the workflow to limit runs on (only applies to schedule events)

Schedule Example

name: Cleanup Duplicate Branches and PRs  
on:
  schedule:
    - cron:  '*/15 * * * *'
cancel-runs:
  # Prevent forks from running this to be nice
  if: github.repository == 'foo-org/my-repo'
  runs-on: ubuntu-latest
    steps:
      - uses: n1hility/cancel-previous-runs@v3
        with: 
          token: ${{ secrets.GITHUB_TOKEN }}
          workflow: my-heavy-workflow.yml

Alternate/Fallback Example

  test: 
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - uses: n1hility/cancel-previous-runs@v3
      with: 
        token: ${{ secrets.GITHUB_TOKEN }}

License

... (truncated)

Commits
  • e709d8e Update dependencies to latest and refactor code
  • 6447949 Merge pull request #29 from n1hility/dependabot/npm_and_yarn/json5-2.2.3
  • f868496 Merge pull request #28 from n1hility/dependabot/npm_and_yarn/qs-6.5.3
  • a46d7bf Merge pull request #27 from n1hility/dependabot/npm_and_yarn/decode-uri-compo...
  • aba816d Merge pull request #26 from n1hility/dependabot/npm_and_yarn/actions/core-1.9.1
  • bc9f50e Merge pull request #23 from n1hility/dependabot/npm_and_yarn/ajv-6.12.6
  • 651e5a9 Merge pull request #22 from n1hility/dependabot/npm_and_yarn/tmpl-1.0.5
  • 34c9406 Merge pull request #21 from n1hility/dependabot/npm_and_yarn/path-parse-1.0.7
  • bc5ac22 Merge pull request #18 from n1hility/dependabot/npm_and_yarn/hosted-git-info-...
  • 14bfe23 Merge pull request #17 from n1hility/dependabot/npm_and_yarn/lodash-4.17.21
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [n1hility/cancel-previous-runs](https://github.com/n1hility/cancel-previous-runs) from 2 to 3.
- [Release notes](https://github.com/n1hility/cancel-previous-runs/releases)
- [Commits](n1hility/cancel-previous-runs@v2...v3)

---
updated-dependencies:
- dependency-name: n1hility/cancel-previous-runs
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot requested a review from emmartins as a code owner March 7, 2024 15:26
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Mar 7, 2024
@emmartins emmartins merged commit f1d9e21 into main Mar 7, 2024
@dependabot dependabot bot deleted the dependabot/github_actions/n1hility/cancel-previous-runs-3 branch March 7, 2024 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant