Skip to content

Commit

Permalink
Merge pull request #24274 from storybookjs/norbert/gh-pr-creation-bug…
Browse files Browse the repository at this point in the history
…-fixed

Build: Cancel when the PR count is 0
  • Loading branch information
ndelangen authored Sep 22, 2023
2 parents b308e54 + 2fa0afa commit cf3fdaf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/prepare-patch-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ jobs:
git config --global user.email '[email protected]'
yarn release:pick-patches
- name: Cancel when 0 picked
if: steps.pick-patches.outputs.pr-count == '0'
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: Bump version deferred
id: bump-version
if: steps.unreleased-changes.outputs.has-changes-to-release == 'true'
Expand Down
4 changes: 4 additions & 0 deletions scripts/release/pick-patches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ export const run = async (_: unknown) => {
spinner.warn('No PRs found.');
}

if (process.env.GITHUB_ACTIONS === 'true') {
setOutput('pr-count', JSON.stringify(patchPRs.length));
}

const failedCherryPicks: string[] = [];

// eslint-disable-next-line no-restricted-syntax
Expand Down

0 comments on commit cf3fdaf

Please sign in to comment.