Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: Don't auto-trigger CI on release PRs #23198

Merged
merged 5 commits into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/trigger-circle-ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ on:
branches:
- next
- main
- version-prerelease-from-**
- version-patch-from-**
Comment on lines -12 to -13
Copy link
Contributor Author

@JReinhold JReinhold Jun 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need this as it should already be covered by "pull_request_target" > "synchronize", and removing these makes sure the "merged" workflow doesn't trigger unnecessarily.


jobs:
get-branch:
Expand Down Expand Up @@ -56,7 +54,7 @@ jobs:
trigger-pr-tests:
runs-on: ubuntu-latest
needs: get-branch
if: github.event_name == 'pull_request_target' && ((github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ci:pr')) && !contains(github.event.pull_request.labels.*.name, 'ci:merged') && !contains(github.event.pull_request.labels.*.name, 'ci:daily'))
if: github.event_name == 'pull_request_target' && (((github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'release')) || contains(github.event.pull_request.labels.*.name, 'ci:pr')) && !contains(github.event.pull_request.labels.*.name, 'ci:merged') && !contains(github.event.pull_request.labels.*.name, 'ci:daily'))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trigger PR tests if:

  1. is "pull_request_target" event
  2. AND
    1. (not draft
    2. AND not "release")
    3. OR has "ci:pr" label
  3. AND don't have "ci:merged"
  4. AND don't have "ci:daily"

steps:
- name: Trigger PR tests
run: >
Expand Down Expand Up @@ -109,4 +107,4 @@ jobs:
}'
env:
CIRCLE_CI_TOKEN: ${{ secrets.CIRCLE_CI_TOKEN }}
BRANCH: ${{ needs.get-branch.outputs.branch }}
BRANCH: ${{ needs.get-branch.outputs.branch }}
20 changes: 18 additions & 2 deletions scripts/release/__tests__/generate-pr-description.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ For each pull request below, you need to either manually cherry pick it, or disc
Before merging the PR, there are a few QA steps to go through:

- [ ] Add the \\"freeze\\" label to this PR, to ensure it doesn\\'t get automatically forced pushed by new changes.
- [ ] Add the \\"ci:daily\\" label to this PR, to trigger the full test suite to run on this PR.

And for each change below:

Expand Down Expand Up @@ -235,6 +236,13 @@ For each pull request below, you need to either manually cherry pick it, or disc
"This is an automated pull request. None of the changes requires a version bump, they are only internal or documentation related. Merging this PR will not trigger a new release, but documentation will be updated.
If you\\'re not a core maintainer with permissions to release you can ignore this pull request.

## To do

Before merging the PR:

- [ ] Add the \\"freeze\\" label to this PR, to ensure it doesn\\'t get automatically forced pushed by new changes.
- [ ] Add the \\"ci:daily\\" label to this PR, to trigger the full test suite to run on this PR.

This is a list of all the PRs merged and commits pushed directly to \\\`next\\\` since the last release:

- **🐛 Bug**: Some PR title for a bug [#42](https://github.com/storybookjs/storybook/pull/42)
Expand Down Expand Up @@ -263,7 +271,7 @@ For each pull request below, you need to either manually cherry pick it, or disc

- [ ] [#42](https://github.com/storybookjs/storybook/pull/42): \\\`git cherry-pick -m1 -x abc123\\\`

If you\\'ve made any changes (change PR titles, revert PRs), manually trigger a re-generation of this PR with [this workflow](https://github.com/storybookjs/storybook/actions/workflows/prepare-prerelease.yml) and wait for it to finish.
If you\\'ve made any changes (change PR titles, revert PRs), manually trigger a re-generation of this PR with [this workflow](https://github.com/storybookjs/storybook/actions/workflows/prepare-patch-release.yml) and wait for it to finish.

When everything above is done:
- Merge this PR
Expand Down Expand Up @@ -294,6 +302,7 @@ For each pull request below, you need to either manually cherry pick it, or disc
Before merging the PR, there are a few QA steps to go through:

- [ ] Add the \\"freeze\\" label to this PR, to ensure it doesn\\'t get automatically forced pushed by new changes.
- [ ] Add the \\"ci:daily\\" label to this PR, to trigger the full test suite to run on this PR.

And for each change below:

Expand Down Expand Up @@ -350,6 +359,13 @@ For each pull request below, you need to either manually cherry pick it, or disc
"This is an automated pull request. None of the changes requires a version bump, they are only internal or documentation related. Merging this PR will not trigger a new release, but documentation will be updated.
If you\\'re not a core maintainer with permissions to release you can ignore this pull request.

## To do

Before merging the PR:

- [ ] Add the \\"freeze\\" label to this PR, to ensure it doesn\\'t get automatically forced pushed by new changes.
- [ ] Add the \\"ci:daily\\" label to this PR, to trigger the full test suite to run on this PR.

This is a list of all the PRs merged and commits pushed directly to \\\`next\\\` since the last release:

- **🐛 Bug**: Some PR title for a bug [#42](https://github.com/storybookjs/storybook/pull/42)
Expand All @@ -373,7 +389,7 @@ For each pull request below, you need to either manually cherry pick it, or disc



If you\\'ve made any changes (change PR titles, revert PRs), manually trigger a re-generation of this PR with [this workflow](https://github.com/storybookjs/storybook/actions/workflows/prepare-prerelease.yml) and wait for it to finish.
If you\\'ve made any changes (change PR titles, revert PRs), manually trigger a re-generation of this PR with [this workflow](https://github.com/storybookjs/storybook/actions/workflows/prepare-patch-release.yml) and wait for it to finish.

When everything above is done:
- Merge this PR
Expand Down
10 changes: 9 additions & 1 deletion scripts/release/generate-pr-description.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ export const generateReleaseDescription = ({
Before merging the PR, there are a few QA steps to go through:

- [ ] Add the "freeze" label to this PR, to ensure it doesn't get automatically forced pushed by new changes.
- [ ] Add the "ci:daily" label to this PR, to trigger the full test suite to run on this PR.

And for each change below:

Expand Down Expand Up @@ -199,13 +200,20 @@ export const generateNonReleaseDescription = (
dedent`This is an automated pull request. None of the changes requires a version bump, they are only internal or documentation related. Merging this PR will not trigger a new release, but documentation will be updated.
If you're not a core maintainer with permissions to release you can ignore this pull request.

## To do

Before merging the PR:

- [ ] Add the "freeze" label to this PR, to ensure it doesn't get automatically forced pushed by new changes.
- [ ] Add the "ci:daily" label to this PR, to trigger the full test suite to run on this PR.

This is a list of all the PRs merged and commits pushed directly to \`next\` since the last release:

${changeList}

${manualCherryPicks || ''}

If you've made any changes (change PR titles, revert PRs), manually trigger a re-generation of this PR with [this workflow](https://github.com/storybookjs/storybook/actions/workflows/prepare-prerelease.yml) and wait for it to finish.
If you've made any changes (change PR titles, revert PRs), manually trigger a re-generation of this PR with [this workflow](https://github.com/storybookjs/storybook/actions/workflows/prepare-patch-release.yml) and wait for it to finish.

When everything above is done:
- Merge this PR
Expand Down