Use concurrency instead of if

This commit is contained in:
Josh de Leeuw 2025-01-17 11:02:29 -05:00 committed by GitHub
parent 846602b45f
commit df83261d74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,11 +2,13 @@ name: build
on: [push, pull_request] on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
test: test:
name: Build, lint, and test on Node.js ${{ matrix.node }} name: Build, lint, and test on Node.js ${{ matrix.node }}
# Prevent the action running twice when the event is both a push and pull request
if: github.event_name != 'push' || github.event_name == 'push' && !github.event.pull_request
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix: