Repository navigation
Set persist-credentials: false on actions/checkout - #9
anish-sujanani wants to merge 1 commit into
Conversation
actions/checkout persists the GITHUB_TOKEN in .git/config by default. Setting persist-credentials: false removes it, as defence in depth against a later step exposing it via an artifact, a log, or a dependency script. See PM_GH_REPO_036.
|
Closing — not resolvable, and not worth resolving. This PR adds The underlying PM_GH_REPO_036 finding is still open, though. Note also that #8 reintroduces |
Set
persist-credentials: falseonactions/checkoutactions/checkoutwrites a credential for theGITHUB_TOKENinto.git/configand leaves itthere for the rest of the job. Nothing in this repository is leaking it today — this change removes
the material that a later mistake would expose: an artifact upload whose path includes the
repository root, a debug step that prints git config, a broad Docker build context, or a
dependency's install script reading the workspace.
What changed
1
actions/checkoutstep across 1 workflow file. One or twoadded lines per step; nothing else moves.
postman.yaml→quality-checksWhy this is safe here
The job(s) changed here perform no
gitorghoperation against the origin — nothing reads the credential from.git/config— so behaviour is unchanged.A job only depends on the persisted credential if it runs
git pushorgit tagagainst theorigin. Where a token is passed explicitly — via
env:or as an action input — it is unaffected bythis change, because
ghand actions read it from the environment rather than from git's config.Verification
The edit was checked three ways before raising: the parsed YAML is identical once the added keys
are stripped, the number of added lines matches the number of
actions/checkoutsteps in eachfile, and
actionlintreports no new issues.If this breaks something
Say so and I will revert it — a defence-in-depth change is not worth a broken pipeline. If a job
turns out to need the credential, the fix is to authenticate explicitly rather than ambiently
(
git push "https://x-access-token:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.git" ...) and I amhappy to make that change instead.
Raised as part of a CI/CD security posture review (control PM_GH_REPO_036).