Skip to content

ci: drop persisted token from preview checkouts - #39

Merged
ko3n1g merged 1 commit into
NVIDIA-NeMo:mainfrom
ko3n1g:ko3n1g/ci/harden-workflow-credentials
Dec 1, 2026
Merged

ko3n1g merged 1 commit into
NVIDIA-NeMo:mainfrom
ko3n1g:ko3n1g/ci/harden-workflow-credentials

Conversation

@ko3n1g

@ko3n1g ko3n1g commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Background

  • Today, every run of rotate-profile-readme.yml keeps its checkout token in .git/config, including pull_request and dry-run runs that never push.
  • Those runs then execute scripts/rotate_readme.py from the checked-out tree.

What changed

  • After this PR, runs that do not push will check out with persist-credentials: false.
  • Runs that push will keep the persisted App-token checkout they use today.

Details

  • .github/workflows/rotate-profile-readme.yml:63: persist-credentials: ${{ env.PUSH == 'true' }}.
    • PUSH is a job-level boolean, already used by the step if: conditions.
    • On the push path the input is "true", which is actions/checkout's default, so git push, git fetch and git rebase behave as today.
    • On the preview path the commit step is skipped, and rotate_readme.py makes no git calls. It reads public repository metadata with the job's read-only GITHUB_TOKEN.
  • Triggers, schedule, author identity and pushed files are unchanged.

Tested

  • actionlint 1.7.12: clean before and after.
  • zizmor 1.33.1: artipacked goes from 1 to 0.
  • actions/checkout v4.2.2 parses the input as (getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE'.
  • Recent logs render PUSH: true in scheduled run 46435851509 and PUSH: false in PR run 42326015330.
  • python3 scripts/rotate_readme.py --offline --dry-run exits 0 and leaves the tree unchanged.
  • The preview path runs on this PR.

🤖 Generated with Claude Code

Runs that do not push check out with persist-credentials: false. The push path keeps its persisted App-token checkout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: oliver könig <[email protected]>
@ko3n1g
ko3n1g requested a review from a team as a code owner December 1, 2026 19:10
@ko3n1g
ko3n1g merged commit bedfebe into NVIDIA-NeMo:main Dec 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant