Skip to content

fix: implement cleanup() to remove the PAT (#30)#39

Closed
ifauzeee wants to merge 1 commit into
vlang:mainfrom
ifauzeee:fix/implement-cleanup-remove-pat
Closed

fix: implement cleanup() to remove the PAT (#30)#39
ifauzeee wants to merge 1 commit into
vlang:mainfrom
ifauzeee:fix/implement-cleanup-remove-pat

Conversation

@ifauzeee

@ifauzeee ifauzeee commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

cleanup() in src/main.ts was an empty @todo, even though README.md and action.yml state that the post-job step removes the PAT.

Implemented it (#30):

  • Best-effort git config --global --unset-all http.https://github.com/.extraheader (wrapped in try/catch so a missing header or unavailable git is harmless).
  • Clear GITHUB_TOKEN via core.exportVariable('GITHUB_TOKEN', '') so subsequent steps cannot reuse the token.

Verification

  • npm run build && npm run package succeeds; bundled cleanup() performs the cleanup.

Closes #30

cleanup() was an empty @todo even though README/action.yml claim the
post-job step removes the PAT. Implement it: best-effort unset of the
git extraheader that may carry the token, plus clear GITHUB_TOKEN so
later steps cannot reuse it. (vlang#30)

Rebuild dist via ncc.
@ulises-jeremias

Copy link
Copy Markdown
Member

Thanks @ifauzeee! Implements the cleanup function that was a // @todo. Verified locally — git config unset + exportVariable works correctly. Merging!

ulises-jeremias added a commit that referenced this pull request Jul 15, 2026
Co-authored-by: ifauzeee <ifauzeee@users.noreply.github.com>
@ulises-jeremias

Copy link
Copy Markdown
Member

Rebased on latest main (after #38 merged) and rebuilt dist/index.js. Pushing the fixed version to a new branch and will link it here.

@ulises-jeremias

Copy link
Copy Markdown
Member

The cleanup() implementation has been merged to main (commit 3e4fb41). Closing this PR as the changes are now in the main branch. Thanks @ifauzeee for the original implementation!

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.

fix: implement cleanup() to actually remove the PAT

2 participants