Repository navigation
fix(workflows): complete #3016 interpolation triage follow-up #3023
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
Changes from 16 commits
e526b6f
f6e4c31
0284784
56e1435
7e6599b
cd7dd47
e57f713
a415bc7
1ad8fa5
9806419
cc6575f
3419156
754d8d7
e4a9ad3
474688e
4f2da0b
a725b5d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Workflow script interpolation triage (#3016) | ||
|
|
||
| Follow-up to merged PR #3020. This documents the repository-wide review of | ||
| `${{ inputs.* }}` and `${{ github.event.* }}` expressions that appear inside | ||
| `run:` or `with.script:` block scalars. | ||
|
|
||
| ## Summary | ||
|
|
||
| | Category | Count | Action | | ||
| | --- | ---: | --- | | ||
| | Free-text inputs moved to `env:` in #3020 | 3 fields | `commit_message`, `codex_args`, `repos` | | ||
| | Additional free-text fixes in this PR | 4 fields | `target_repo`, `commit_prefix`, `head_repository`, campaign script outputs | | ||
| | Reviewed constrained interpolations | 97 | Explicit allowlist in `test_no_untrusted_interpolation.py` | | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Reconcile the reviewed-interpolation count. Line 13 states 🤖 Prompt for AI Agents |
||
|
|
||
| ## Free-text inputs (must use `env:` indirection) | ||
|
|
||
| These workflow-dispatch or runner inputs are free-form text and must never | ||
| appear directly inside a `run:`/`script:` scalar: | ||
|
|
||
| - `inputs.commit_message` — fixed in #3020 (`maint-70`) | ||
| - `inputs.codex_args` — fixed in #3020 (`reusable-codex-run`) | ||
| - `inputs.repos` — fixed in #3020 (maint/health sync workflows) | ||
| - `inputs.target_repo` — fixed here (`maint-72`) | ||
| - `inputs.commit_prefix` — fixed here (`reusable-18-autofix`) | ||
| - `inputs.head_repository` — fixed here (`agents-keepalive-branch-sync`) | ||
|
|
||
| The regression guard bans these expressions in script bodies and fails if they | ||
| reappear. | ||
|
|
||
| ## Constrained-value allowlist | ||
|
|
||
| The remaining 103 `(workflow, step, expression)` tuples are provably | ||
| constrained: | ||
|
|
||
| - **Booleans / dry-run flags** — `inputs.dry_run`, `inputs.create_issue`, etc. | ||
| - **Numeric identifiers** — `inputs.pr_number`, `inputs.issue_number`, `github.event.issue.number` | ||
| - **Repo-controlled refs** — `github.event.pull_request.base.ref`, `github.event.repository.default_branch` | ||
| - **Enumerated modes** — `inputs.mode`, `inputs.agent_key`, `inputs.provider`, `inputs.package-manager`, `inputs.test-runner` | ||
| - **Step output passthrough** — `steps.registered.outputs.repos` consumed via step `env:` in `maint-82` | ||
|
|
||
| Each tuple is recorded in `REVIEWED_SCRIPT_INTERPOLATIONS` inside | ||
| `tests/workflows/test_no_untrusted_interpolation.py`. Adding a new | ||
| `inputs.*`/`github.event.*` script interpolation requires updating that set and | ||
| this document. | ||
|
|
||
| ## Test gate | ||
|
|
||
| `tests/workflows/test_no_untrusted_interpolation.py::test_no_untrusted_expressions_in_script_bodies` | ||
| parses every workflow file, walks `run:`/`script:` scalars, and asserts: | ||
|
|
||
| 1. Banned free-text expressions do not appear. | ||
| 2. Every other `inputs.*`/`github.event.*` hit is present in the reviewed allowlist. | ||
|
|
||
| Deliberate-break check (from issue acceptance criteria): re-introduce | ||
| `git commit -m "${{ inputs.commit_message }}"` in `maint-70` and confirm the | ||
| named test fails. | ||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.