Skip to content

ci: regenerate NOTICE.txt for all PRs, not just bots - #418

Merged
MattDevy merged 3 commits into
mainfrom
fix/regenerate-notice-for-all-prs
Jun 16, 2026
Merged

ci: regenerate NOTICE.txt for all PRs, not just bots#418
MattDevy merged 3 commits into
mainfrom
fix/regenerate-notice-for-all-prs

Conversation

@margaretjgu

Copy link
Copy Markdown
Member

Problem

The regenerate-notice workflow had a bot-only guard (if: startsWith(github.event.pull_request.user.login, 'elastic-renovate') || ...), so it only auto-committed an updated NOTICE.txt for Renovate/Dependabot PRs.

When a human updated package.json, NOTICE.txt merged without being regenerated. Once stale on main, every subsequent PR — even ones that never touched packages — failed the notice-file CI check, hence the "random" failures.

Fix

  • Remove the bot-only if: guard so the workflow runs for any same-repo PR that touches package.json or package-lock.json.
  • Add a push trigger on main as a second safety net (catches anything that merges with a stale NOTICE.txt).
  • Fork PRs are explicitly skipped since GITHUB_TOKEN cannot push to a fork's branch.

Result

Any PR that changes dependencies gets NOTICE.txt auto-committed before the notice-file CI check runs on the follow-up commit, so the check always passes.

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.
@margaretjgu
margaretjgu requested a review from JoshMock June 16, 2026 16:04
@margaretjgu
margaretjgu requested a review from MattDevy June 16, 2026 16:04
@github-actions

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 1 0 0 0.28s
✅ COPYPASTE jscpd yes no no 9.8s
✅ REPOSITORY gitleaks yes no no 64.09s
✅ REPOSITORY git_diff yes no no 0.8s
✅ REPOSITORY secretlint yes no no 34.0s
✅ REPOSITORY trivy yes no no 16.54s
✅ YAML yamllint 1 0 0 0.69s

Notices

📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)

See detailed reports in MegaLinter artifacts
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

@MattDevy MattDevy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Legend

@MattDevy
MattDevy merged commit 3b5771a into main Jun 16, 2026
26 checks passed
@MattDevy
MattDevy deleted the fix/regenerate-notice-for-all-prs branch June 16, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants