From 06418882b180cc2e44f2447af22f18dea2b2b739 Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Sun, 4 Feb 2024 21:51:05 -0800 Subject: [PATCH] chore: cancel previous GHA from the same PR (#84) --- .github/workflows/buildifier.yaml | 2 +- .github/workflows/ci.yaml | 11 ++++++++--- .github/workflows/release.yml | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/buildifier.yaml b/.github/workflows/buildifier.yaml index 6072277..fb60469 100644 --- a/.github/workflows/buildifier.yaml +++ b/.github/workflows/buildifier.yaml @@ -15,6 +15,6 @@ jobs: check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: buildifier run: bazel run --enable_bzlmod //:buildifier.check diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5debf57..1c4ca28 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,6 +11,11 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +concurrency: + # Cancel previous actions from the same PR: https://stackoverflow.com/a/72408109 + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: # matrix-prep-* steps dynamically generate a bit of JSON depending on whether our action has # access to repository secrets. When running on a pull_request from a fork, the author is @@ -22,7 +27,7 @@ jobs: # Prepares the 'bazelversion' axis of the test matrix runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - id: bazel_6 run: echo "bazelversion=$(head -n 1 .bazelversion)" >> $GITHUB_OUTPUT - id: bazel_5 @@ -35,7 +40,7 @@ jobs: # Prepares the 'os' axis of the test matrix runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - id: linux run: echo "os=ubuntu-latest" >> $GITHUB_OUTPUT - id: macos @@ -76,7 +81,7 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # Cache build and external artifacts so that the next ci build is incremental. # Because github action caches cannot be updated after a build, we need to diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 138bc1b..00906bb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Mount bazel caches uses: actions/cache@v3 with: