Run the widget gallery from CI rather than workflow_run - #578
Merged
Merged
Conversation
SonarCloud failed main's quality gate on githubactions:S7631: a workflow_run workflow runs with the repository's token and secrets after any CI run, a fork's pull request included, so building checked-out code there is a privileged context untrusted code could reach. The gallery always checked out main, but the trigger itself is the risk the rule names. The gallery is now a reusable workflow that ci.yml calls as a job needing the pipeline, only for a push to main. Only a push to main or a manual dispatch on main can start it, and both need write access, so nothing a fork wrote is ever built with its permissions. Ordering after the release commit is unchanged, since the job still waits for the whole pipeline. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UAiQ9k8PXay5udWkN4vi3U
|
This was referenced Oct 1, 2026
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.



Before: the widget gallery ran as a
workflow_runworkflow after CI.workflow_runruns with the repository's token after every CI run, including one started by a fork's pull request. SonarCloud flags that as githubactions:S7631 (forked code checked out in a privileged context), which failed main's quality gate with a C security rating and skipped the release.After: the gallery is a reusable workflow.
ci.ymlcalls it as awidget-galleryjob thatneedsthe pipeline, and only for a push tomain. It can also be dispatched by hand onmain. Both of those need write access, so nothing a fork wrote is ever checked out or built with the job'scontents: write.How:
widget-gallery.ymlnow triggers onworkflow_callandworkflow_dispatch. Its job is gated on thektsu-dev/ImGuiApprepository andrefs/heads/main.workflow_run.actionlint passes on both workflows.
🤖 Generated with Claude Code
https://claude.ai/code/session_01UAiQ9k8PXay5udWkN4vi3U
Generated by Claude Code