From 350f352fb27a7f802dd594bff1223f4f019a9d61 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Fri, 9 Feb 2024 10:35:16 +0100 Subject: [PATCH] Merge pull request #25942 from storybookjs/jeppe/fix-gh-patch-preparation Release tooling: Fix patch preparation not cancelling when no patches available (cherry picked from commit 903317b51af9b7a5dfe5e90a1f52ba8cebff8625) --- .github/workflows/prepare-patch-release.yml | 8 ++++---- scripts/release/pick-patches.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/prepare-patch-release.yml b/.github/workflows/prepare-patch-release.yml index 5cdc1ba44fcf..91be3acf6f92 100644 --- a/.github/workflows/prepare-patch-release.yml +++ b/.github/workflows/prepare-patch-release.yml @@ -33,7 +33,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version-file: '.nvmrc' + node-version-file: ".nvmrc" - name: Cache dependencies uses: actions/cache@v3 @@ -89,7 +89,7 @@ jobs: yarn release:pick-patches - name: Cancel when no patches to pick - if: steps.pick-patches.outputs.pr-count == '0' && steps.pick-patches.outputs.pr-count != null + if: steps.pick-patches.outputs.no-patch-prs == 'true' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # From https://stackoverflow.com/a/75809743 @@ -123,7 +123,7 @@ jobs: run: | yarn release:write-changelog ${{ steps.versions.outputs.next }} --unpicked-patches --verbose - - name: 'Commit changes to branch: version-patch-from-${{ steps.versions.outputs.current }}' + - name: "Commit changes to branch: version-patch-from-${{ steps.versions.outputs.current }}" working-directory: . run: | git config --global user.name 'storybook-bot' @@ -185,4 +185,4 @@ jobs: DISCORD_WEBHOOK: ${{ secrets.DISCORD_MONITORING_URL }} uses: Ilshidur/action-discord@master with: - args: 'The GitHub Action for preparing the release pull request bumping from v${{ steps.versions.outputs.current }} to v${{ steps.versions.outputs.next }} (triggered by ${{ github.triggering_actor }}) failed! See run at: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' + args: "The GitHub Action for preparing the release pull request bumping from v${{ steps.versions.outputs.current }} to v${{ steps.versions.outputs.next }} (triggered by ${{ github.triggering_actor }}) failed! See run at: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" diff --git a/scripts/release/pick-patches.ts b/scripts/release/pick-patches.ts index be713f5f5d51..3dc9bf719eb4 100644 --- a/scripts/release/pick-patches.ts +++ b/scripts/release/pick-patches.ts @@ -81,7 +81,7 @@ export const run = async (_: unknown) => { } if (process.env.GITHUB_ACTIONS === 'true') { - setOutput('pr-count', JSON.stringify(patchPRs.length)); + setOutput('no-patch-prs', patchPRs.length === 0); setOutput('failed-cherry-picks', JSON.stringify(failedCherryPicks)); } };