Skip to content

Commit

Permalink
Merge pull request #23432 from storybookjs/fix-double-publishing
Browse files Browse the repository at this point in the history
Release tooling: Fix double run of publish workflow

(cherry picked from commit 4f1fe59)
  • Loading branch information
JReinhold authored and storybook-bot committed Jul 15, 2023
1 parent b1b54e5 commit c036961
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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`
Expand Down

0 comments on commit c036961

Please sign in to comment.