ci: regenerate NOTICE.txt for all PRs, not just bots - #418
Merged
Conversation
The regenerate-notice workflow previously ran only for Renovate/Dependabot PRs. Human PRs that updated package.json merged without regenerating NOTICE.txt, leaving main stale and causing the notice-file CI check to fail on unrelated subsequent PRs. Remove the bot-only guard so the workflow runs for any same-repo PR that touches package.json or package-lock.json. Also add a push-to-main trigger as a second safety net to catch anything that slips through. Fork PRs are skipped explicitly since GITHUB_TOKEN cannot push to a fork's branch.
Contributor
✅MegaLinter analysis: Success
Notices📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining See detailed reports in MegaLinter artifacts MegaLinter is graciously provided by OX Security |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
regenerate-noticeworkflow had a bot-only guard (if: startsWith(github.event.pull_request.user.login, 'elastic-renovate') || ...), so it only auto-committed an updatedNOTICE.txtfor Renovate/Dependabot PRs.When a human updated
package.json,NOTICE.txtmerged without being regenerated. Once stale onmain, every subsequent PR — even ones that never touched packages — failed thenotice-fileCI check, hence the "random" failures.Fix
if:guard so the workflow runs for any same-repo PR that touchespackage.jsonorpackage-lock.json.pushtrigger onmainas a second safety net (catches anything that merges with a staleNOTICE.txt).GITHUB_TOKENcannot push to a fork's branch.Result
Any PR that changes dependencies gets
NOTICE.txtauto-committed before thenotice-fileCI check runs on the follow-up commit, so the check always passes.