Repository navigation
Conversation
Refs obs-rust#4461. The check fails against the current ai-rebase.yaml: its root job reads secrets.AI_REBASE_TOKEN in steps with no configured guard, so checkout paid for setup and then died. GREEN adds the guard.
Refs obs-rust#4461. Fold secrets.AI_REBASE_TOKEN != '' into the root job if alongside the fork guard, so an unconfigured repository skips the optional job instead of failing actions/checkout with a missing token. Ci-Attestation: local RED/GREEN pairs for ci/test_ai_rebase_token_guard and ci/test_workflow_schedule_guard; 9 unit tests pass on the branch tip.
|
Marked ready for review. Local evidence: RED/GREEN pair is on the branch tip; |
|
The new job-level condition makes this workflow invalid, including when the token is configured. On ae0f6e7, actionlint 1.7.11 reports: GitHub's context availability table excludes One valid option is to retain the existing job-level fork guard, set a job environment flag, and guard all five steps (checkout, uv, soldr, clud, and rebase): env:
AI_REBASE_ENABLED: ${{ secrets.AI_REBASE_TOKEN != '' }}
# On each step:
if: env.AI_REBASE_ENABLED == 'true'I applied that alternative to a temporary copy of this exact workflow: actionlint passes. It skips setup when the token is absent, although a runner still starts. Avoiding that runner requires a separately maintained repository variable or preflight output. Please adjust the regression to validate allowed contexts and coverage of every setup step, rather than matching the secret expression in the job condition. |
wesleyhawes
left a comment
There was a problem hiding this comment.
The workflow validation blocker remains at this head. I also ran all four new Python tests against this exact workflow: they pass despite the invalid expression, because they check for the guard's text rather than validating its allowed context. Please replace the condition with a supported guard and include workflow validation in the regression checks. The earlier review includes a step-guard alternative that passes actionlint. Prepared with AI assistance.
| jobs: | ||
| rebase: | ||
| if: github.event_name != 'schedule' || github.repository == 'obs-rust/obs-studio' | ||
| if: >- |
There was a problem hiding this comment.
[P1] secrets is unavailable in jobs.<job_id>.if, so this condition makes the workflow invalid instead of skipping an unconfigured job. actionlint 1.7.11 reports context "secrets" is not allowed here at 41:92. GitHub lists only github, needs, vars and inputs for this position in its context availability table. Keep the fork guard here and use a supported preflight or step-level guard; a boolean job environment flag must guard every setup/execution step, including checkout.
Refs #4461.
actions/checkoutin.github/workflows/ai-rebase.yamlfails withInput required and not supplied: tokenwhenAI_REBASE_TOKENis unset, so optional master pushes armed the job, paid for setup, then died before its rebase logic (run 42724921146 of the #4450 push).RED (e70b5cb):ci/test_ai_rebase_token_guard.pypins that every root job readingsecrets.AI_REBASE_TOKENcarries a configured guard; it fails against the current yaml (only the real-yaml case fails; parser cases pass).GREEN (ae0f6e7): foldsecrets.AI_REBASE_TOKEN != ''into the root jobif:alongside the existing fork guard, so an unconfigured repo skips the optional job instead of failing checkout. The fork-guard substring is preserved, soci/test_workflow_schedule_guard.pystill passes.Local validation:ci/test_ai_rebase_token_guard.py,ci/test_workflow_schedule_guard.pyandci/test_workflow_duplicate_keys.pypass (17 tests) on the branch tip; the yaml parses with PyYAML;git diff --checkclean../lintfails here only from environment noise (spaces in this workspace path break the uvx-pinned spawn; and default cp1252 needsPYTHONUTF8=1), unrelated to the change.