-
Notifications
You must be signed in to change notification settings - Fork 482
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: Add condition to skip job when PR author is Bot #3433
Conversation
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 need documentation tests to run on the update-checkers workflows (e.g. #3411) so this isn't going to work as-is, but maybe it could be tweaked to look for a bit more than just startsWith "chore" so it looks specifically for sbom vs checker updates and does the right thing?
There's also a third type of bot action we use right now for updating the pre-commit config (e.g. #3120 ) and that one definitely needs to run linters but it's ok to skip tests and docs, so this PR shouldn't affect it poorly.
There's also a bot action for updating the year in the SPDX stub we provide, but we don't need to run tests there either so these should be fine.
I think longer-term something that checked what files were changed would be applicable in more cases (e.g. it would be nice to not run tests if you only change .md files or somesuch) , but short-term this seems like a bit of tweaking could make this at least solve the problem for the sbom and checker PRs.
Codecov Report
@@ Coverage Diff @@
## main #3433 +/- ##
==========================================
- Coverage 80.49% 74.79% -5.70%
==========================================
Files 758 758
Lines 11616 11616
Branches 1571 1571
==========================================
- Hits 9350 8688 -662
- Misses 1842 2584 +742
+ Partials 424 344 -80
Flags with carried forward coverage won't be shown. Click here to find out more. see 15 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Hii @terriko , I think it would be nice to check the branch name for specific case. I've create a recap all of the bot action, this recap only contains job on the
|
We probably want to run tests (but not documentation) on update-js-dependencies. I'm pretty sure the chore-update_database-copy one is only available to run manually at the moment. I should probably delete that job entirely, since it's been replaced by the global mirror. If you want a very easy PR for hacktoberfest, feel free to go ahead and do separate one that git rm's the associated yml file, since you reminded me that it exists. :) |
Skip the job if: - Author is github-actions[bot] - Branch name is listed on jobs
d3c69b0
to
70d3f9a
Compare
New commit changes the logic, now test will skipped if:
Anyway, I'll delete |
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.
Looks good; let's get this merged and hopefully we'll have much faster SBOM jobs when they trigger next week!
Fixes #3415
Constraint
Job will skip if match this condition:
Description
This approach is different from my comment on the issue because i see there's a pattern on the PR created by
github-actions
. Also, I see several workflow file for automatic update on this repo (sbom, js dependencies, etc). I think this changes has pros and cons described below.I use github context to retrieve information about the PR author and the source branch ref
Pros
github-actions[bot]
Cons
sbom/
will trigger the testsTesting
I've test this on my private repo, here's the screenshot