GH-2426: refactor(ci): docs-version-sync — replace token-via-output with native || fallback#2427
Merged
alekspetrov merged 1 commit intomainfrom Apr 27, 2026
Merged
GH-2426: refactor(ci): docs-version-sync — replace token-via-output with native || fallback#2427alekspetrov merged 1 commit intomainfrom
|| fallback#2427alekspetrov merged 1 commit intomainfrom
Conversation
4 tasks
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Summary
Automated PR created by Pilot for task GH-2426.
Closes #2426
Changes
GitHub Issue #2426: refactor(ci): docs-version-sync — replace token-via-output with native
||fallbackSummary
GH-2423 (PR #2424, merged as `f47ad6a5`) added a `Resolve token` step that writes the resolved token to `$GITHUB_OUTPUT`. GitHub auto-masks registered secrets passing through outputs, so this is not a confirmed leak today, but it's a brittle pattern: any future transformation (trim, base64-encode, reformat) breaks the masker, after which the raw token leaks into step logs.
Replace with the idiomatic `${{ secrets.A || secrets.B }}` expression — the secret is never written to a step output, masking is robust against future code changes, and the workflow gets shorter.
Required changes (`.github/workflows/docs-version-sync.yml`)
Remove the entire `Resolve token` step (lines ~49-60 today):
```yaml
id: token
env:
PILOT_DOCS_PAT: ${{ secrets.PILOT_DOCS_PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ -n "$PILOT_DOCS_PAT" ]; then
echo "token=$PILOT_DOCS_PAT" >> "$GITHUB_OUTPUT"
else
echo "::warning::PILOT_DOCS_PAT not set — sync-docs.yml will not chain from the auto-merge"
echo "token=$GITHUB_TOKEN" >> "$GITHUB_OUTPUT"
fi
```
Replace with a warning-only step:
```yaml
if: ${{ !secrets.PILOT_DOCS_PAT }}
run: echo "::warning::PILOT_DOCS_PAT not set — auto-merge will use GITHUB_TOKEN, sync-docs.yml will not chain"
```
Update the two consumer references:
GitHub treats unset secrets as empty strings → falsy in `||` and `if:` expressions. The `||` operator's result is still a registered-secret value, fully masked through the rest of the run.
Acceptance
Out of scope
Files