Cancel Runs on Workflow Cancellation
Cancel the Currents run when a GitHub Actions workflow is cancelled
Last updated
Was this helpful?
Was this helpful?
name: Run Playwright Tests
on:
pull_request:
branches: [main]
# Cancel the previous run when a new commit is pushed to the same branch.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
run-tests:
runs-on: ubuntu-latest
env:
CURRENTS_PROJECT_ID: ${{ vars.CURRENTS_PROJECT_ID }}
CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}
CURRENTS_CI_BUILD_ID: ${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "24.x"
- run: npm ci
- name: Playwright Tests
run: npx playwright test
- name: Cancel the Currents run
if: ${{ cancelled() }}
run: npx currents cancel