feat: cancel with a record key #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 'build-test' | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| - 'releases/*' | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24.x | |
| cache: npm | |
| - run: npm ci | |
| - run: npm run all | |
| test: | |
| # Runs the packaged action the way a consumer would. Pointed at a port | |
| # nothing listens on, so it exercises the retry and failure path. | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: ./ | |
| id: cancel | |
| continue-on-error: true | |
| with: | |
| api-url: 'http://localhost:4000/v1' | |
| api-token: token | |
| - name: The step fails, the workflow does not | |
| run: | | |
| if [ "${{ steps.cancel.outcome }}" != "failure" ]; then | |
| echo "Expected the action to fail against an unreachable API" | |
| exit 1 | |
| fi |