From 57d4f4f42fad1caba13540c38f90a26d8f133a68 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 13 Jul 2023 09:58:55 +0200 Subject: [PATCH] Merge pull request #23432 from storybookjs/fix-double-publishing Release tooling: Fix double run of publish workflow (cherry picked from commit 4f1fe599239645f0585472165b714ac827cd6aa5) --- .github/workflows/publish.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 23a8f37bfaa4..d319a540c376 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -27,6 +27,15 @@ jobs: run: working-directory: scripts steps: + - name: Cancel if [skip ci] + if: contains(github.event.head_commit.message, '[skip ci]') + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # From https://stackoverflow.com/a/75809743 + run: | + gh run cancel ${{ github.run_id }} + gh run watch ${{ github.run_id }} + - name: Checkout ${{ github.ref_name }} uses: actions/checkout@v3 with: @@ -71,7 +80,7 @@ jobs: git config --global user.name "storybook-bot" git config --global user.email "32066757+storybook-bot@users.noreply.github.com" git add . - git commit -m "Bump version from $CURRENT_VERSION to $DEFERRED_NEXT_VERSION" || true + git commit -m "Bump version from $CURRENT_VERSION to $DEFERRED_NEXT_VERSION [skip ci]" || true git push origin ${{ github.ref_name }} - name: Get current version @@ -149,7 +158,7 @@ jobs: git pull git checkout origin/main ./CHANGELOG.md git add ./CHANGELOG.md - git commit -m "Update CHANGELOG.md for v${{ steps.version.outputs.current-version }}" + git commit -m "Update CHANGELOG.md for v${{ steps.version.outputs.current-version }} [skip ci]" git push origin next - name: Sync versions/next.json from `next` to `main`