-
Notifications
You must be signed in to change notification settings - Fork 195
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
ci: use pull_request closed event for selective vrt runs #3254
base: main
Are you sure you want to change the base?
Conversation
|
🚀 Deployed on https://pr-3254--spectrum-css.netlify.app |
File metricsSummaryTotal size: 4.30 MB* 🎉 No changes detected in any packages * Size determined by adding together the size of the main file for all packages in the library.* Results are not gzipped or minified. * An ASCII character in UTF-8 is 8 bits or 1 byte. |
@@ -25,7 +32,8 @@ permissions: | |||
|
|||
jobs: | |||
vrt: | |||
if: ${{!startsWith(github.ref, 'refs/heads/dependabot/') && !startsWith(github.ref, 'refs/heads/changeset-release/') }} | |||
# if the branch being merged is a dependabot branch or a changeset release, skip everything in this workflow | |||
if: ${{!startsWith(github.head_ref, 'dependabot') && !startsWith(github.head_ref, 'changeset-release') }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may need to also check that it was closed
due to a merge
, because this might run for anything that is closed without merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this add additional runs on closed PRs instead of reducing the number of runs against main?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! I need to exclude it from regular closures instead of "closures that are merges".
This refines our vrt action to attempt to skip the workflow when it encounters a dependabot or changeset release PR. It uses the GH `pull_request: closed` event type to listen for PRs merging into selected branches (`main`, `spectrum_two`, `s2-foundations-redux`), then checks against the `head_ref` variable to see if it starts with a certain name. If the `head_ref` starts with a flagged name, it skips the rest of the workflow.
1f7185b
to
563f011
Compare
push: | ||
branches: | ||
- main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
push: | |
branches: | |
- main | |
push: | |
branches: | |
- main |
If we add the below pull_request logic, I think we should remove the push trigger so that we prevent it running twice.
@@ -25,7 +32,8 @@ permissions: | |||
|
|||
jobs: | |||
vrt: | |||
if: ${{!startsWith(github.ref, 'refs/heads/dependabot/') && !startsWith(github.ref, 'refs/heads/changeset-release/') }} | |||
# if the branch being merged is a dependabot branch or a changeset release, skip everything in this workflow | |||
if: ${{!startsWith(github.head_ref, 'dependabot') && !startsWith(github.head_ref, 'changeset-release') }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if: ${{!startsWith(github.head_ref, 'dependabot') && !startsWith(github.head_ref, 'changeset-release') }} | |
if: ${{ github.event.pull_request.merged == 'true' }} |
This refines our vrt action to attempt to skip the workflow when it encounters a dependabot or changeset release PR.
It uses the GH
pull_request: closed
event type to listen for PRs merging into selected branches (main
,spectrum_two
,s2-foundations-redux
), then checks against thehead_ref
variable to see if it starts with a certain name. If thehead_ref
starts with a flagged name, it skips the rest of the workflow.Description
How and where has this been tested?
Please tag yourself on the tests you've marked complete to confirm the tests have been run by someone other than the author.
Validation steps
Regression testing
Validate:
Screenshots
To-do list