Skip to content

ci(hacktoberfest_prep): authenticate git push via gh credential helper - #15262

Merged
cclauss merged 1 commit into
TheAlgorithms:masterfrom
priya-sundaram-dev:fix/hacktoberfest-prep-push-auth
Sep 10, 2026
Merged

ci(hacktoberfest_prep): authenticate git push via gh credential helper#15262
cclauss merged 1 commit into
TheAlgorithms:masterfrom
priya-sundaram-dev:fix/hacktoberfest-prep-push-auth

Conversation

@priya-sundaram-dev

Copy link
Copy Markdown
Contributor

Describe your change

Fixes the hacktoberfest_prep scheduled/manual workflow, which has been failing on the "Open or update the tracker pull request" step (example run):

fatal: could not read Username for 'https://github.com': No such device or address
##[error]Process completed with exit code 128.

Root cause: the actions/checkout step runs with persist-credentials: false, so git is left with no stored token. The step then calls plain git push, which has nothing to authenticate with. GH_TOKEN is only wired into the gh CLI, not into git itself, so gh pr create would work but the git push before it never gets that far.

Fix: run gh auth setup-git before the push. That registers the already-bundled gh as git's credential helper (credential.https://github.com.helper = !gh auth git-credential), so git push reuses GH_TOKEN. No third-party action, and — unlike embedding the token in the remote URL — nothing secret is written into git config.

Keeping persist-credentials: false is deliberate (it's the safer default zizmor recommends); this just restores auth for the one push that needs it.

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm? — CI workflow fix
  • Add or change tests?
  • Documentation change?

@algorithms-keeper algorithms-keeper Bot added awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files labels Sep 9, 2026
@cclauss
cclauss merged commit 236ea3a into TheAlgorithms:master Sep 10, 2026
7 checks passed
@algorithms-keeper algorithms-keeper Bot removed awaiting reviews This PR is ready to be reviewed labels Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement This PR modified some existing files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants