Repository navigation
ci: run fork PR builds in restricted workflow - #6002
Conversation
📝 WalkthroughWalkthroughThe pull request adds a fork-only CI workflow, guards trusted workflow paths, documents isolated build behavior, and adds a validator for workflow security properties. ChangesFork pull-request build isolation
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ForkPullRequest
participant CIbuildsfork
participant CIbuilds
ForkPullRequest->>CIbuildsfork: Trigger pull_request workflow
CIbuildsfork->>CIbuilds: Invoke reusable workflow with trusted: false
CIbuilds->>CIbuilds: Exclude external workflow_run execution
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/CI-builds-fork.yml:
- Around line 15-17: Derive fork trust from the pull request event rather than
the caller-controlled trusted input, using a predicate such as
github.event.pull_request.head.repo.fork to gate runner selection and privileged
steps. Update .github/workflows/CI-builds-fork.yml:15-17 accordingly; revise
docs/superpowers/plans/2026-08-09-fork-pr-builds.md:160-176 to specify
event-derived trust; and update
test/infra/control/validate-fork-pr-builds.bash:47-64 to validate the
event/actor predicate instead of inputs.trusted.
In @.github/workflows/CI-trigger.yml:
- Line 24: Apply one fail-closed trust predicate across the fork-PR workflow
paths: in .github/workflows/CI-trigger.yml (line 24),
.github/workflows/CI-builds.yml (line 16), and
.github/workflows/CI-builds-fork.yml (line 14), classify Dependabot and other
required untrusted pull-request sources as trusted: false or exclude them from
trusted cascades, including privileged workflow_run paths that inherit secrets.
Update the corresponding trust logic and guidance in
docs/superpowers/plans/2026-08-09-fork-pr-builds.md (lines 216-220) to match;
all listed sites require changes.
In `@docs/superpowers/plans/2026-08-09-fork-pr-builds.md`:
- Around line 145-155: Correct the documented worktree and validation-command
paths so each is resolvable from its stated working directory. Update the
worktree creation instructions near the initial setup and apply the same
relative-path correction at the later references around Steps 180–184 and
280–292. Ensure the validation command locates the primary checkout’s test
script when run from the worktree.
In `@docs/superpowers/specs/2026-08-09-fork-pr-builds-design.md`:
- Around line 22-24: Update the architecture text describing the fork build path
to state that CI-builds-fork.yml invokes the shared ci-builds.yml workflow with
trusted set to false, rather than describing a separate reusable build
implementation. Preserve the documented untrusted-code restrictions and caller
permissions.
In `@test/infra/control/validate-fork-pr-builds.bash`:
- Around line 24-39: Update the validator around the workflow-loading and
routing assertions to load .github/workflows/CI-trigger.yml and validate its
trusted and untrusted paths alongside base, fork, and reusable workflows.
Replace substring include? checks for if expressions with normalized-expression
comparisons against an allowlist covering the exact trusted and untrusted
guards, including both routing cases; retain the existing permission, secret,
trigger, reusable-workflow, and trusted-mode assertions.
- Around line 45-50: Update the reusable workflow input validation near the
existing trusted default assertion to also assert that
inputs.fetch('trusted').fetch('type') equals 'boolean'. Keep the current default
and runs-on checks unchanged.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 092bc8d8-9fa3-40fd-a160-c944420db4ea
📒 Files selected for processing (6)
.github/workflows/CI-builds-fork.yml.github/workflows/CI-builds.yml.github/workflows/CI-trigger.ymldocs/superpowers/plans/2026-08-09-fork-pr-builds.mddocs/superpowers/specs/2026-08-09-fork-pr-builds-design.mdtest/infra/control/validate-fork-pr-builds.bash
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
- GitHub Check: run / trigger
- GitHub Check: build
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2026-04-11T13:17:55.508Z
Learnt from: renecannao
Repo: sysown/proxysql PR: 5607
File: doc/GH-Actions/README.md:13-18
Timestamp: 2026-04-11T13:17:55.508Z
Learning: When using GitHub-flavored Markdown headings, be aware that an em-dash surrounded by spaces (written as ` — `) affects the generated anchor/slug: GitHub replaces spaces with hyphens and removes non-alphanumeric punctuation, which can produce double hyphens (e.g., `## Foo — bar` → anchor `#foo--bar`, not `#foo-bar`). If you reference these anchors (e.g., internal links), ensure the expected slug matches this behavior.
Applied to files:
docs/superpowers/specs/2026-08-09-fork-pr-builds-design.mddocs/superpowers/plans/2026-08-09-fork-pr-builds.md
📚 Learning: 2026-04-11T13:17:55.509Z
Learnt from: renecannao
Repo: sysown/proxysql PR: 5607
File: doc/GH-Actions/README.md:13-18
Timestamp: 2026-04-11T13:17:55.509Z
Learning: When reviewing GitHub-flavored Markdown links/anchors, remember that heading-to-anchor slug generation treats spaces as hyphens and removes punctuation. If a heading contains an em-dash surrounded by spaces (e.g. ` — `), the slugs can legitimately include a double hyphen where the two surrounding space-runs become `-` on either side of the removed em-dash (e.g. `...vocabulary--read...`). Do not flag double-hyphens in anchor links for em-dash-containing headings as errors; they reflect GitHub’s correct slug behavior.
Applied to files:
docs/superpowers/specs/2026-08-09-fork-pr-builds-design.mddocs/superpowers/plans/2026-08-09-fork-pr-builds.md
🪛 LanguageTool
docs/superpowers/plans/2026-08-09-fork-pr-builds.md
[style] ~15-~15: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...rets, and GitHub-hosted runners only. - Fork builds must not use shared cache operat...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[uncategorized] ~205-~205: The official name of this software platform is spelled with a capital “H”.
Context: ...fork.yml **Interfaces:** - Consumes:github.event.workflow_run.head_repository.full...
(GITHUB)
[uncategorized] ~205-~205: The official name of this software platform is spelled with a capital “H”.
Context: ...flow_run.head_repository.full_nameandgithub.event.pull_request.head.repo.fork`. - P...
(GITHUB)
[uncategorized] ~224-~224: The official name of this software platform is spelled with a capital “H”.
Context: ...p 2: Add the fork-only caller** Create .github/workflows/CI-builds-fork.yml: ```yaml...
(GITHUB)
|
|
||
| jobs: | ||
| run: | ||
| if: ${{ !github.event.pull_request || !github.event.pull_request.head.repo.fork }} |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Repo files of interest:"
git ls-files | rg '(^\.github/workflows/(CI-trigger|CI-builds|CI-builds-fork)\.yml$|(?i)dependabot|docs/superpowers/plans/2026-08-09-fork-pr-builds\.md$|validate-fork-pr-builds)' || true
echo
echo "Workflow snippets:"
for f in .github/workflows/CI-trigger.yml .github/workflows/CI-builds.yml .github/workflows/CI-builds-fork.yml; do
if [ -f "$f" ]; then
echo "--- $f"
nl -ba "$f" | sed -n '1,80p'
fi
done
echo
echo "Plan snippet:"
if [ -f docs/superpowers/plans/2026-08-09-fork-pr-builds.md ]; then
nl -ba docs/superpowers/plans/2026-08-09-fork-pr-builds.md | sed -n '130,240p'
fi
echo
echo "Search for reusable workflow inputs/trust labels:"
rg -n "inputs\.trusted|trusted:|secrets: inherit|pull_request\.head\.repo\.fork|workflow_run|same-repository|dependabot|Dependabot|untrusted" .github workflows docs test -S || trueRepository: sysown/proxysql
Length of output: 477
🌐 Web query:
GitHub Actions Dependabot pull_request workflows untrusted GitHub App pull_request event
💡 Result:
When using GitHub Actions with Dependabot, it is critical to understand that GitHub treats these workflows as originating from a potentially untrusted source to prevent security compromises [1][2]. By default, when Dependabot triggers a workflow via events like pull_request, it is treated as if it were opened from a repository fork [2][3]. Key security restrictions and behaviors include: 1. Restricted Tokens and Secrets: Workflows triggered by Dependabot (github.actor == 'dependabot[bot]') receive a read-only GITHUB_TOKEN by default [1][2]. Furthermore, standard GitHub Actions secrets are not available to these runs; only designated Dependabot secrets can be accessed [1][2][3]. You can increase token permissions using the permissions key in your workflow, but secrets remain limited to Dependabot-configured ones [2][4]. 2. The pull_request_target Trigger: This event is a common source of security vulnerabilities (often called "pwn requests") because it runs with the privileges of the base repository [5][6]. If Dependabot triggers a pull_request_target workflow and the base ref was created by Dependabot, the workflow is automatically restricted to a read-only token and no secrets [1][7]. 3. Protection Against Untrusted Code: GitHub has implemented safeguards to prevent the execution of untrusted code in privileged contexts. For instance, actions/checkout v7 and newer now refuse to fetch fork pull request code in pull_request_target and workflow_run workflows unless explicitly opted out [5]. If your workflow requires checking out code from a fork with elevated trust, you must use the allow-unsafe-pr-checkout input, which is a deliberate security decision that should be carefully reviewed [8][5]. For secure operation, the recommended best practice is to separate tasks: use an unprivileged pull_request workflow to handle untrusted code and artifacts, and then use a separate, privileged workflow triggered by workflow_run to process the results of the first task [9]. Avoid using pull_request_target unless absolutely necessary, and always ensure that any code checked out from an untrusted source is never executed directly in a privileged context [8][9][5].
Citations:
- 1: https://docs.github.com/en/code-security/reference/supply-chain-security/dependabot-on-actions
- 2: https://docs.github.com/en/enterprise-cloud@latest/code-security/reference/supply-chain-security/troubleshoot-dependabot/dependabot-on-actions
- 3: https://help.github.com/en/enterprise-server@3.15/code-security/dependabot/troubleshooting-dependabot/troubleshooting-dependabot-on-github-actions
- 4: https://github.blog/changelog/2021-10-06-github-actions-workflows-triggered-by-dependabot-prs-will-respect-permissions-key-in-workflows/
- 5: https://github.blog/changelog/2026-06-18-safer-pull_request_target-defaults-for-github-actions-checkout/
- 6: https://securitylab.github.com/resources/github-actions-new-patterns-and-mitigations/
- 7: https://github.blog/changelog/2021-12-09-github-actions-changes-to-permissions-in-workflows-triggered-by-dependabot/
- 8: https://docs.github.com/en/actions/reference/security/securely-using-pull_request_target
- 9: https://codeql.github.com/codeql-query-help/actions/actions-untrusted-checkout-medium/
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Repo files of interest:"
git ls-files | rg '(^\.github/workflows/CI-(trigger|builds|builds-fork)\.yml$|docs/superpowers/plans/2026-08-09-fork-pr-builds\.md$|test/infra/control/validate-fork-pr-builds\.bash$)' || true
echo
echo "Workflow snippets:"
for f in .github/workflows/CI-trigger.yml .github/workflows/CI-builds.yml .github/workflows/CI-builds-fork.yml; do
if [ -f "$f" ]; then
awk '{ printf "%d\t%s\n", NR, $0 }' "$f" | sed -n '1,120p'
fi
done
echo
echo "Plan snippets:"
if [ -f docs/superpowers/plans/2026-08-09-fork-pr-builds.md ]; then
awk '{ printf "%d\t%s\n", NR, $0 }' docs/superpowers/plans/2026-08-09-fork-pr-builds.md | sed -n '130,245p'
fi
echo
echo "Control validation snippets:"
if [ -f test/infra/control/validate-fork-pr-builds.bash ]; then
awk '{ printf "%d\t%s\n", NR, $0 }' test/infra/control/validate-fork-pr-builds.bash | sed -n '1,130p'
fi
echo
echo "Search for trust inputs/workflow conditions:"
rg -n "inputs\.trusted|trusted:|secrets: inherit|pull_request\.head\.repo\.fork|workflow_run|same-repository|repository|dependabot|Dependabot|untrusted" .github workflows docs test -S || trueRepository: sysown/proxysql
Length of output: 50372
🌐 Web query:
GitHub Actions GitHub Apps pull_request event head.repo.fork false same repository
💡 Result:
In GitHub Actions, the head.repo.fork property available in the pull_request event payload indicates whether the repository itself is a GitHub fork of another repository—not whether the specific pull request originates from a different repository than the base [1][2]. Because this flag reflects the status of the repository, using head.repo.fork == false to identify same-repository pull requests is unreliable [1][2]. A repository that is a fork of an upstream project will have its fork flag set to true, even for internal branches and pull requests created within that same forked repository [1][2]. Consequently, using this flag as a proxy for "same-repo" will cause false positives in forked repositories, as same-repo pull requests will incorrectly report fork: true [2]. To accurately determine if a pull request is from the same repository, you should compare the full names of the base and head repositories instead [1][2]. This check is robust regardless of whether the repository is a fork: if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }} This condition explicitly confirms that the pull request head branch and the base branch reside within the same repository [1][2]. Reliance on head.repo.fork has been explicitly deprecated or removed in some tooling (such as the GitHub CLI) due to this inherent ambiguity [1][2].
Citations:
- 1: fix: Clear stale GH_HOST and remove false fork PR detection (#24208) github/gh-aw#24221
- 2: fix: False fork PR detection on same-repo PRs github/gh-aw#24218
Apply one fail-closed trust predicate across the fork-PR paths.
The PR workflows classify trust as “not a fork head”, and the workflow_run caller only trusts the same repository. GitHub treats Dependabot pull_request flows as untrusted, while workflow_run with secrets: inherit is privileged. Route Dependabot and similar required untrusted sources to trusted: false, or remove them from the trusted cascades. Do this for .github/workflows/CI-trigger.yml, .github/workflows/CI-builds.yml, .github/workflows/CI-builds-fork.yml, and the matching docs plan.
📍 Affects 4 files
.github/workflows/CI-trigger.yml#L24-L24(this comment).github/workflows/CI-builds.yml#L16-L16.github/workflows/CI-builds-fork.yml#L14-L14docs/superpowers/plans/2026-08-09-fork-pr-builds.md#L216-L220
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/CI-trigger.yml at line 24, Apply one fail-closed trust
predicate across the fork-PR workflow paths: in .github/workflows/CI-trigger.yml
(line 24), .github/workflows/CI-builds.yml (line 16), and
.github/workflows/CI-builds-fork.yml (line 14), classify Dependabot and other
required untrusted pull-request sources as trusted: false or exclude them from
trusted cascades, including privileged workflow_run paths that inherit secrets.
Update the corresponding trust logic and guidance in
docs/superpowers/plans/2026-08-09-fork-pr-builds.md (lines 216-220) to match;
all listed sites require changes.
| git worktree add .worktrees/ci-fork-pr-builds-actions -b ci/fork-pr-builds-actions origin/GH-Actions | ||
| ``` | ||
|
|
||
| Add checks that require `inputs.trusted` to guard the cache restore/save/packing steps, both `LouisBrunner/checks-action` steps, every handoff upload, and the diagnostic artifact upload. | ||
|
|
||
| - [ ] **Step 2: Confirm the extended test fails** | ||
|
|
||
| Run from `.worktrees/ci-fork-pr-builds-actions`: | ||
|
|
||
| ```bash | ||
| bash ../ci-fork-pr-builds/test/infra/control/validate-fork-pr-builds.bash ci/fork-pr-builds HEAD |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Fix the documented worktree paths.
Line 145 creates the worktree below the primary checkout. From that worktree, ../ci-fork-pr-builds/test/... does not reach the primary checkout. From the primary checkout, ../ci-fork-pr-builds-actions does not reach .worktrees/ci-fork-pr-builds-actions.
Use paths relative to the documented locations.
Proposed path correction
- bash ../ci-fork-pr-builds/test/infra/control/validate-fork-pr-builds.bash ci/fork-pr-builds HEAD
+ bash ../../test/infra/control/validate-fork-pr-builds.bash ci/fork-pr-builds HEAD
- git -C ../ci-fork-pr-builds-actions diff origin/GH-Actions...ci/fork-pr-builds-actions -- .github/workflows/ci-builds.yml
+ git -C .worktrees/ci-fork-pr-builds-actions diff origin/GH-Actions...ci/fork-pr-builds-actions -- .github/workflows/ci-builds.ymlApply the same correction to Lines 183 and 292.
Also applies to: 180-184, 280-292
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/superpowers/plans/2026-08-09-fork-pr-builds.md` around lines 145 - 155,
Correct the documented worktree and validation-command paths so each is
resolvable from its stated working directory. Update the worktree creation
instructions near the initial setup and apply the same relative-path correction
at the later references around Steps 180–184 and 280–292. Ensure the validation
command locates the primary checkout’s test script when run from the worktree.
| `CI-builds` remains a `workflow_run` workflow. It must skip its privileged reusable build job when the upstream workflow run originates from a fork. This prevents `actions/checkout` from trying to fetch a fork commit while the job has the base repository's write-capable token. | ||
|
|
||
| A new direct `pull_request` workflow runs the four build variants for fork heads. It uses a separate reusable build implementation designed for untrusted code. The caller grants only `contents: read`; the reusable workflow does not inherit secrets, use self-hosted runners, publish custom check runs, restore or save shared caches, upload handoff artifacts, or trigger downstream test workflows. |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Align the architecture text with the implementation.
Line 24 describes a separate reusable build implementation. .github/workflows/CI-builds-fork.yml calls the shared ci-builds.yml@GH-Actions workflow with trusted: false. Use the shared-workflow wording so the design and deployment contract match.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/superpowers/specs/2026-08-09-fork-pr-builds-design.md` around lines 22 -
24, Update the architecture text describing the fork build path to state that
CI-builds-fork.yml invokes the shared ci-builds.yml workflow with trusted set to
false, rather than describing a separate reusable build implementation. Preserve
the documented untrusted-code restrictions and caller permissions.
| base = workflow(ENV.fetch('BASE_BUILDS')) | ||
| fork = workflow(ENV.fetch('FORK_BUILDS')) | ||
| reusable = workflow(ENV.fetch('REUSABLE_BUILDS')) | ||
|
|
||
| base_run = base.fetch('jobs').fetch('run') | ||
| assert(base_run.fetch('if').include?('head_repository.full_name == github.repository'), 'trusted CI-builds lacks same-repository guard') | ||
| assert(base_run.fetch('permissions') == 'write-all', 'trusted CI-builds permission changed') | ||
| assert(base_run.fetch('secrets') == 'inherit', 'trusted CI-builds secret handoff changed') | ||
|
|
||
| fork_event = fork['on'] || fork[true] | ||
| fork_run = fork.fetch('jobs').fetch('run') | ||
| assert(fork_event.key?('pull_request'), 'fork workflow is not pull_request-triggered') | ||
| assert(fork.fetch('permissions') == { 'contents' => 'read' }, 'fork workflow permissions are not exactly contents: read') | ||
| assert(fork_run.fetch('if').include?('head.repo.fork'), 'fork workflow is not restricted to fork heads') | ||
| assert(fork_run.fetch('uses') == 'sysown/proxysql/.github/workflows/ci-builds.yml@GH-Actions', 'fork workflow uses the wrong reusable workflow') | ||
| assert(fork_run.fetch('with').fetch('trusted') == false, 'fork workflow does not select untrusted mode') |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift
Validate every trusted routing guard.
The validator never loads .github/workflows/CI-trigger.yml, even though the PR changes its fork guard. It also uses include? checks for if expressions. An expression containing the required fragment plus an unconditional || true would pass.
Load CI-trigger.yml and compare normalized expressions against an allowlist for the final trust contract. Test both trusted and untrusted cases.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@test/infra/control/validate-fork-pr-builds.bash` around lines 24 - 39, Update
the validator around the workflow-loading and routing assertions to load
.github/workflows/CI-trigger.yml and validate its trusted and untrusted paths
alongside base, fork, and reusable workflows. Replace substring include? checks
for if expressions with normalized-expression comparisons against an allowlist
covering the exact trusted and untrusted guards, including both routing cases;
retain the existing permission, secret, trigger, reusable-workflow, and
trusted-mode assertions.
| reusable_event = reusable['on'] || reusable.fetch(true) | ||
| inputs = reusable_event.fetch('workflow_call').fetch('inputs') | ||
| assert(inputs.fetch('trusted').fetch('default') == true, 'reusable workflow lacks trusted=true default') | ||
| builds = reusable.fetch('jobs').fetch('builds') | ||
| runs_on = builds.fetch('runs-on') | ||
| assert(runs_on.match?(/\A\$\{\{\s*inputs\.trusted\s*&&\s*\(/) && runs_on.match?(/\)\s*\|\|\s*'ubuntu-24\.04'\s*\}\}\z/), 'untrusted mode does not force ubuntu-24.04') |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Files matching validate-fork-pr-builds.bash:"
fd -a 'validate-fork-pr-builds\.bash$' . || true
file="$(fd 'validate-fork-pr-builds\.bash$' . | head -n1)"
if [ -n "${file:-}" ]; then
echo
echo "File: $file"
wc -l "$file"
echo
echo "Relevant lines:"
sed -n '1,120p' "$file" | cat -n
fi
echo
echo "Search for reusable workflow/test input assertions:"
rg -n "trusted|workflow_call|inputs\.fetch|assert\(inputs\.fetch|type.*boolean" . --glob '!node_modules' --glob '!dist' --glob '!build' | head -n 200Repository: sysown/proxysql
Length of output: 50372
🏁 Script executed:
#!/bin/bash
set -euo pipefail
file="$(git ls-files | grep -F 'test/infra/control/validate-fork-pr-builds.bash' | head -n1)"
echo "Target file: ${file:-not found}"
if [ -n "${file:-}" ]; then
wc -l "$file"
echo
sed -n '1,120p' "$file" | cat -n
fi
echo
echo "Controlled targeted search:"
git ls-files | grep -F 'validate-fork-pr-builds.bash' | head -n 20
rg -n "validate-fork-pr-builds|trusted|workflow_call|inputs\.fetch|assert\(|\.fetch\(" test infra .github --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' --max-count 300 | head -n 350Repository: sysown/proxysql
Length of output: 12559
🌐 Web query:
GitHub Actions reusable workflows workflow_call inputs type boolean required optional syntax
💡 Result:
To define a boolean input in a GitHub Actions reusable workflow, you must use the on.workflow_call.inputs keyword and specify type: boolean [1][2][3]. When defining inputs for a workflow_call trigger, the type parameter is mandatory and must be one of boolean, number, or string [1][2]. Syntax Example To define a boolean input, use the following structure within your reusable workflow file: on: workflow_call: inputs: my-boolean-input: description: 'An example boolean input' type: boolean required: false default: false Configuration Details - type: Must be set to boolean for this input type [1][3]. - required: A boolean value (true or false) indicating if the input is mandatory. If set to false, you can provide a default value [1][2]. - default: If no default is specified for a boolean input, it defaults to false [1][2]. - Accessing inputs: Within the called (reusable) workflow, you can access the input value using the ${{ inputs.input-id }} context [1][3]. Passing the Input In the caller workflow, you pass the input value using the with keyword within your job configuration [4][3]. The data type provided by the caller must match the type defined in the reusable workflow [4]. jobs: call-my-workflow: uses: octo-org/example-repo/.github/workflows/reusable.yml@main with: my-boolean-input: true
Citations:
- 1: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax?use_case=
- 2: https://docs.github.com/enterprise-cloud@latest/actions/using-workflows/workflow-syntax-for-github-actions
- 3: https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions
- 4: https://docs.github.com/en/actions/how-tos/reuse-automations/reuse-workflows
🌐 Web query:
site:docs.github.com/reusable-workflows reusable workflow inputs type default required
💡 Result:
In GitHub Actions reusable workflows, the on.workflow_call.inputs configuration allows you to define parameters passed from a caller workflow. Each input requires the type parameter, while required and default are optional [1]. Key configuration details include: Type: The type parameter is required for every input defined in a reusable workflow [1]. Valid values are boolean, number, or string [1]. Required: The required parameter is a boolean that determines if the input must be provided by the caller [2][1]. Default: The default parameter is optional. If it is not specified, the system assigns a default value based on the input's type [1]: - Boolean: false - Number: 0 - String: "" (empty string) Example configuration: on: workflow_call: inputs: username: description: 'A username passed from the caller workflow' default: 'john-doe' required: false type: string
Citations:
- 1: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax?use_case=
- 2: https://docs.github.com/en/enterprise-server@3.19/actions/how-tos/reuse-automations/reuse-workflows
Assert that trusted has type: boolean.
workflow_call inputs require an explicit type, and the reusable workflow should only pass boolean logic to ${{ inputs.trusted }}. Add a missing type assertion so a reusable workflow with a non-boolean input does not make this validator pass.
Proposed assertion
assert(inputs.fetch('trusted').fetch('default') == true, 'reusable workflow lacks trusted=true default')
+assert(inputs.fetch('trusted').fetch('type') == 'boolean', 'trusted input is not boolean')📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| reusable_event = reusable['on'] || reusable.fetch(true) | |
| inputs = reusable_event.fetch('workflow_call').fetch('inputs') | |
| assert(inputs.fetch('trusted').fetch('default') == true, 'reusable workflow lacks trusted=true default') | |
| builds = reusable.fetch('jobs').fetch('builds') | |
| runs_on = builds.fetch('runs-on') | |
| assert(runs_on.match?(/\A\$\{\{\s*inputs\.trusted\s*&&\s*\(/) && runs_on.match?(/\)\s*\|\|\s*'ubuntu-24\.04'\s*\}\}\z/), 'untrusted mode does not force ubuntu-24.04') | |
| reusable_event = reusable['on'] || reusable.fetch(true) | |
| inputs = reusable_event.fetch('workflow_call').fetch('inputs') | |
| assert(inputs.fetch('trusted').fetch('default') == true, 'reusable workflow lacks trusted=true default') | |
| assert(inputs.fetch('trusted').fetch('type') == 'boolean', 'trusted input is not boolean') | |
| builds = reusable.fetch('jobs').fetch('builds') | |
| runs_on = builds.fetch('runs-on') | |
| assert(runs_on.match?(/\A\$\{\{\s*inputs\.trusted\s*&&\s*\(/) && runs_on.match?(/\)\s*\|\|\s*'ubuntu-24\.04'\s*\}\}\z/), 'untrusted mode does not force ubuntu-24.04') |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@test/infra/control/validate-fork-pr-builds.bash` around lines 45 - 50, Update
the reusable workflow input validation near the existing trusted default
assertion to also assert that inputs.fetch('trusted').fetch('type') equals
'boolean'. Keep the current default and runs-on checks unchanged.
|



What changed
Adds a fork-only
pull_requestcaller that runs the existing four build variants through the shared reusable workflow withtrusted: false.The existing
CI-trigger→CI-buildscascade now skips fork heads; its write-capable path remains available for same-repository heads only.Why
Approved external PR workflows should build the contributor's code without running it in the privileged
workflow_runcontext.Validation
Depends on #6001. Merge #6001 first, then this PR. After both merge, verify a controlled fork PR creates four GitHub-hosted jobs and no privileged
CI-buildsjob.Summary by CodeRabbit
New Features
Documentation
Tests