Update README.md
1 file changed
tree: 3a57547fdd194d8ab4a86a2469b33fc772177441
  1. .github/
  2. __tests__/
  3. dist/
  4. src/
  5. .eslintignore
  6. .eslintrc.json
  7. .gitignore
  8. .prettierignore
  9. .prettierrc.json
  10. action.yml
  11. jest.config.js
  12. LICENSE
  13. package-lock.json
  14. package.json
  15. README.md
  16. tsconfig.json
README.md

cancel-previous-runs

[BETA] This action cancels all previous runs on the same branch, effectively limiting the resource consumption of the workflow using this action to one run per branch.

Usage

This action should be placed as an early step in your workflow (e.g. after chekout), so that it can abort the other running jobs before consuming additional capacity. Additionally, it requires that the running Github Action token (located in the secrets context) be passed as an input parameter so that it can list and cancel workflow runs associated with the workflow's repository.

Inputs

token - The github token passed from ${{ secrets.GITHUB_TOKEN }}. Since workflow files are visible in the repository, DO NOT HARDODE A TOKEN ONLY USE A REFERENCE.

Example

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

License

The scripts and documentation in this project are released under the MIT License