Skip to content

ci: Skip the AI rebase steps when AI_REBASE_TOKEN is not set - #4888

Merged
rdoupe merged 2 commits into
masterfrom
ci/4461-ai-rebase-token-guard
Nov 16, 2026
Merged

rdoupe merged 2 commits into
masterfrom
ci/4461-ai-rebase-token-guard

Conversation

@rdoupe

@rdoupe rdoupe commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #4461

The AI rebase workflow passed secrets.AI_REBASE_TOKEN straight to actions/checkout, so in a repository without that secret every run failed with Input required and not supplied: token. GitHub does not allow secrets in a job if: (that is why #4730 was closed), so:

  • the job sets HAS_TOKEN: ${{ secrets.AI_REBASE_TOKEN != '' }} in its env;
  • every step is guarded on env.HAS_TOKEN == 'true';
  • one extra step, guarded on != 'true', prints ::notice::AI_REBASE_TOKEN is not set, so this run rebases nothing. so the skip is visible in the run.

The rebase step itself is unchanged apart from a shellcheck disable=SC2086 line: $PRS and $DRY split into arguments on purpose, and without it actionlint reported three shellcheck notes on the file. The CI gate is not touched.

Evidence

RED (commit eec17883b, the new test against the unchanged workflow):

$ uv run --no-project python -m unittest ci/test_ai_rebase_token_guard.py
FAIL: test_real_workflow_is_guarded
AssertionError: Lists differ: ["rebase: no job env variable set from `secrets.AI_REBASE_TOKEN != ''`"] != []
FAIL: test_real_workflow_says_why_it_skipped
AssertionError: 0 != 1
FAILED (failures=2)

The test's own checker cases (an unguarded job, secrets in a job if:, one unguarded step, a fully guarded job) pass on both commits.

GREEN (this head):

$ uv run --no-project python -m unittest ci/test_ai_rebase_token_guard.py
Ran 5 tests ... OK
$ actionlint ai-rebase.yaml        # actionlint 1.7.12
(no output, exit 0)
$ ./lint
== lane lint: ok

ci/test_workflow_schedule_guard.py and ci/test_workflow_duplicate_keys.py still pass.

🤖 Generated with Claude Code

rdoupe and others added 2 commits November 16, 2026 04:24
The real workflow passes AI_REBASE_TOKEN straight to actions/checkout, so
a repository without that secret gets a red run. The new check fails until
every step is guarded on a job env flag set from the secret; it also
rejects `secrets` in a job `if:`, which GitHub does not allow.

Refs #4461

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
actions/checkout failed with "Input required and not supplied: token" on
every master push of a repository without the secret. GitHub does not
allow `secrets` in a job `if:`, so the job sets HAS_TOKEN in its env and
every step checks it; without the token the run prints one notice and
succeeds. A shellcheck directive covers PRS and DRY, which split into
arguments on purpose, so actionlint reports nothing for the file.

Refs #4461

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ci-Attestation: {"at":1794821242,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["eec17883b31bf55cd944813d9f7eaa5b41b2a080"],"secs":54,"stamp":"903e71eff217ee45132570c26c84e9a4","tree":"3048451576af9a789fd648b32823f242b9e5181f","v":1,"via":"run"}
Ci-Attestation: {"at":1794821242,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["eec17883b31bf55cd944813d9f7eaa5b41b2a080"],"secs":54,"stamp":"c272dd106e4db5b69cd7c3ded5843b29","tree":"3048451576af9a789fd648b32823f242b9e5181f","v":1,"via":"run"}
Ci-Attestation: {"at":1794821242,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["eec17883b31bf55cd944813d9f7eaa5b41b2a080"],"secs":54,"stamp":"7762eb890d08ec0afa0ad2d93025c387","tree":"3048451576af9a789fd648b32823f242b9e5181f","v":1,"via":"run"}
Ci-Attestation: {"at":1794821242,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["eec17883b31bf55cd944813d9f7eaa5b41b2a080"],"secs":54,"stamp":"aa81c6279b0e8f86ca2de1db6a2b563b","tree":"3048451576af9a789fd648b32823f242b9e5181f","v":1,"via":"run"}
Ci-Attestation: {"at":1794821186,"gate":"general/all/client-lint","host":"linux-x86_64","key":"053fb229c735a20c0c1a49ed477d2f42bd3e4bc7ee068827c7a936ade4cc1895","lane":"client-lint","parents":["eec17883b31bf55cd944813d9f7eaa5b41b2a080"],"secs":9,"stamp":"842795822936d00964dda439c3962ec6","tree":"3048451576af9a789fd648b32823f242b9e5181f","v":1,"via":"run"}
Ci-Attestation: {"at":1794821242,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["eec17883b31bf55cd944813d9f7eaa5b41b2a080"],"secs":54,"stamp":"6705a3add7c245822f0cd785c2f8a7a3","tree":"3048451576af9a789fd648b32823f242b9e5181f","v":1,"via":"run"}
Ci-Attestation: {"at":1794821187,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"053fb229c735a20c0c1a49ed477d2f42bd3e4bc7ee068827c7a936ade4cc1895","lane":"client-lint","parents":["eec17883b31bf55cd944813d9f7eaa5b41b2a080"],"secs":9,"stamp":"c6d3e8cf30d8fe20db2acf2508d17b17","tree":"3048451576af9a789fd648b32823f242b9e5181f","v":1,"via":"run"}
Ci-Attestation: {"at":1794821187,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"053fb229c735a20c0c1a49ed477d2f42bd3e4bc7ee068827c7a936ade4cc1895","lane":"client-lint","parents":["eec17883b31bf55cd944813d9f7eaa5b41b2a080"],"secs":9,"stamp":"9e562fd7e1266775eb99724b5d9b739f","tree":"3048451576af9a789fd648b32823f242b9e5181f","v":1,"via":"run"}
Ci-Attestation: {"at":1794821187,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"053fb229c735a20c0c1a49ed477d2f42bd3e4bc7ee068827c7a936ade4cc1895","lane":"client-lint","parents":["eec17883b31bf55cd944813d9f7eaa5b41b2a080"],"secs":9,"stamp":"036bf3fde04c94c52d386b27b621572d","tree":"3048451576af9a789fd648b32823f242b9e5181f","v":1,"via":"run"}
Ci-Attestation: {"at":1794821187,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"053fb229c735a20c0c1a49ed477d2f42bd3e4bc7ee068827c7a936ade4cc1895","lane":"client-lint","parents":["eec17883b31bf55cd944813d9f7eaa5b41b2a080"],"secs":9,"stamp":"fbab428d3b376a59f6698852a1dd88d7","tree":"3048451576af9a789fd648b32823f242b9e5181f","v":1,"via":"run"}
Ci-Attestation: {"at":1794821186,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"053fb229c735a20c0c1a49ed477d2f42bd3e4bc7ee068827c7a936ade4cc1895","lane":"client-lint","parents":["eec17883b31bf55cd944813d9f7eaa5b41b2a080"],"secs":9,"stamp":"8d3ca73b4b6f95361fa1237f30cbc212","tree":"3048451576af9a789fd648b32823f242b9e5181f","v":1,"via":"run"}
Ci-Attestation: {"at":1794821186,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"053fb229c735a20c0c1a49ed477d2f42bd3e4bc7ee068827c7a936ade4cc1895","lane":"client-lint","parents":["eec17883b31bf55cd944813d9f7eaa5b41b2a080"],"secs":9,"stamp":"4a433fe94382b9aedc86f5dfcd9e1c43","tree":"3048451576af9a789fd648b32823f242b9e5181f","v":1,"via":"run"}
Ci-Attestation: {"at":1794821187,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"053fb229c735a20c0c1a49ed477d2f42bd3e4bc7ee068827c7a936ade4cc1895","lane":"client-lint","parents":["eec17883b31bf55cd944813d9f7eaa5b41b2a080"],"secs":9,"stamp":"5029528ba8c646136abebf2e4824c964","tree":"3048451576af9a789fd648b32823f242b9e5181f","v":1,"via":"run"}
Ci-Attestation: {"at":1794821187,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"053fb229c735a20c0c1a49ed477d2f42bd3e4bc7ee068827c7a936ade4cc1895","lane":"client-lint","parents":["eec17883b31bf55cd944813d9f7eaa5b41b2a080"],"secs":9,"stamp":"524420046deda1bca2dfba1e68db88d1","tree":"3048451576af9a789fd648b32823f242b9e5181f","v":1,"via":"run"}
Ci-Attestation: {"at":1794821186,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"053fb229c735a20c0c1a49ed477d2f42bd3e4bc7ee068827c7a936ade4cc1895","lane":"client-lint","parents":["eec17883b31bf55cd944813d9f7eaa5b41b2a080"],"secs":9,"stamp":"409fa7d7d08abe167f2a3144c4b925e8","tree":"3048451576af9a789fd648b32823f242b9e5181f","v":1,"via":"run"}
Ci-Attestation: {"at":1794821187,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"053fb229c735a20c0c1a49ed477d2f42bd3e4bc7ee068827c7a936ade4cc1895","lane":"client-lint","parents":["eec17883b31bf55cd944813d9f7eaa5b41b2a080"],"secs":9,"stamp":"f806a69aa8aa66251921909440a55b8a","tree":"3048451576af9a789fd648b32823f242b9e5181f","v":1,"via":"run"}
Ci-Attestation: {"at":1794821186,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"053fb229c735a20c0c1a49ed477d2f42bd3e4bc7ee068827c7a936ade4cc1895","lane":"client-lint","parents":["eec17883b31bf55cd944813d9f7eaa5b41b2a080"],"secs":9,"stamp":"c751e2dad10ce40f3bdf87b9f08491b4","tree":"3048451576af9a789fd648b32823f242b9e5181f","v":1,"via":"run"}
Ci-Attestation: {"at":1794821186,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"053fb229c735a20c0c1a49ed477d2f42bd3e4bc7ee068827c7a936ade4cc1895","lane":"client-lint","parents":["eec17883b31bf55cd944813d9f7eaa5b41b2a080"],"secs":9,"stamp":"bad5077737acd35630c19f1a9d1993fc","tree":"3048451576af9a789fd648b32823f242b9e5181f","v":1,"via":"run"}
Ci-Attestation: {"at":1794821481,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"959e07692f51ac0fff258d78eeec46fb7fd0896bf99642aea28e80eae476a80d","lane":"client-test-x86_64-unknown-linux-gnu","parents":["eec17883b31bf55cd944813d9f7eaa5b41b2a080"],"secs":239,"stamp":"f5651ed94552672022b80d8353724e8b","tree":"3048451576af9a789fd648b32823f242b9e5181f","v":1,"via":"run"}

Client-Checks: {"checks":{"base":"390b55edb206c56e08c063098b433b0d1818f7d2","coverage":"all-tracked-applicable-files","diff":[".github/workflows/ai-rebase.yaml","ci/test_ai_rebase_token_guard.py"],"head":"ac6ce7fc120a55a4c8e4fa5faea72bcd8e119767","tools":{"orchestrator-python":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]","schema-dependencies":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]\n{'jsonschema': '4.26.0', 'json_source_map': '1.0.5'}","uv":"uv 0.13.5 (x86_64-unknown-linux-gnu)","xmllint":"xmllint: using libxml version 21504-GITv2.15.4\n   compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ICU ISO8859X Regexps Automata RelaxNG Schemas Schematron Modules Debug Zlib"},"tracked-digest":"d4f83a5d9e1ef1aeca78a990982a53fd22ffb7d6737c94f1e52f48e61864c33d","tree":"3048451576af9a789fd648b32823f242b9e5181f"}}
@rdoupe rdoupe changed the title ci: Skip the AI rebase steps when AI_REBASE_TOKEN is not set (GREEN) ci: Skip the AI rebase steps when AI_REBASE_TOKEN is not set Nov 16, 2026
@rdoupe
rdoupe marked this pull request as ready for review November 16, 2026 09:52
@rdoupe
rdoupe requested a review from zackees as a code owner November 16, 2026 09:52
@rdoupe
rdoupe added this pull request to the merge queue Nov 16, 2026
Merged via the queue into master with commit 0881be7 Nov 16, 2026
42 checks passed
@rdoupe
rdoupe deleted the ci/4461-ai-rebase-token-guard branch November 16, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

AI rebase checkout fails when AI_REBASE_TOKEN is unavailable (#4451)

1 participant