A collection of Github Actions. https://github.com/features/actions
This action will use the Github Workflow API to cancel all queued and in progress jobs for the current branch or PR.
Influenced by:
- https://github.com/styfle/cancel-workflow-action
- https://github.com/n1hility/cancel-previous-runs
jobs:
init:
if: "! contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
steps:
- uses: brad-jones/actions/cancel-redundant@v1.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
Now just make all your other jobs depend on init
and they will a) be canceled
if a newer commit is pushed and b) they will never run if the ubiquitous
[skip ci]
text in included in your commit message.
NOTE: The
GITHUB_TOKEN
provided for PRs will not have enough permissions to cancel jobs. So if you want this to work for PRs you would need to setup a second token that has therepo
&workflow
scopes.
This is a simple wrapper for the https://www.npmjs.com/package/replace-in-file module.
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: brad-jones/actions/search-replace-file@v1.0.0
with:
files: ./version.js
from: /commit-sha-goes-here/
to: ${{ github.sha }}
files
: should be a valid glob file path.from
: is expected to be a Regular Expressionto
: the text to use as the replacement for all matches
Installs the dartlang SDK https://dart.dev
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: brad-jones/actions/setup-dart@v1.0.0
with:
version: 2.7.1
version
: is optional and will default to the latest stable release