Fix CodeQL alert: Remove secret token export in handle-fix-commit action#302
Fix CodeQL alert: Remove secret token export in handle-fix-commit action#302
Conversation
Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates the internal composite action used by “fix” workflows to address a CodeQL alert about secret handling during automated fix commits.
Changes:
- Removes exporting the PAT as
GITHUB_TOKENand uses the token directly where needed. - Attempts to tighten permissions for the temporary
~/.git-credentialsfile viaumask 077.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Review the full CodeQL report for details. |
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (74.46%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. @@ Coverage Diff @@
## main #302 +/- ##
==========================================
+ Coverage 74.28% 74.46% +0.18%
==========================================
Files 124 124
Lines 2955 2961 +6
Branches 513 516 +3
==========================================
+ Hits 2195 2205 +10
+ Misses 540 534 -6
- Partials 220 222 +2
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
CodeQL flagged the handle-fix-commit action for exporting secrets as environment variables, which exposes tokens in process listings and error output.
Changes
export GITHUB_TOKEN=${{ inputs.token }}and used the token inline where neededumask 077to ensure 600 permissionsThe trap-based cleanup remains unchanged; functionality is identical.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.