Skip to content

Commit cda95c2

Browse files
vaindclaude
andcommitted
fix(updater): Add token validation and git credential configuration
Addresses GitHub Actions checkout authentication issues by: - Adding early token validation with clear error messages - Configuring git credentials explicitly to prevent "terminal prompts disabled" errors This helps prevent and diagnose common token issues like: - Expired tokens - Missing expiration dates - Insufficient scopes - Incorrect secret references Related to actions/checkout#664 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 6272a50 commit cda95c2

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

updater/action.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,30 @@ runs:
117117
}
118118
Write-Output "✓ Post-update script path '${{ inputs.post-update-script }}' is valid"
119119
120+
- name: Validate GitHub token
121+
shell: bash
122+
env:
123+
GH_TOKEN: ${{ inputs.api-token }}
124+
run: |
125+
if ! gh api repos/${{ github.repository }} --silent; then
126+
echo "::error::GitHub token validation failed. Please verify:"
127+
echo " 1. Token has not expired"
128+
echo " 2. Token has an expiration date set"
129+
echo " 3. Token has 'repo' and 'workflow' scopes"
130+
echo " 4. Token syntax is correct: \${{ secrets.TOKEN_NAME }}"
131+
exit 1
132+
fi
133+
echo "✓ GitHub token is valid and has access to this repository"
134+
135+
- name: Configure git credentials
136+
shell: bash
137+
env:
138+
GH_TOKEN: ${{ inputs.api-token }}
139+
run: |
140+
git config --global credential.https://github.com.username git
141+
git config --global credential.https://github.com.password "$GH_TOKEN"
142+
echo "✓ Git credentials configured for GitHub operations"
143+
120144
# What we need to accomplish:
121145
# * update to the latest tag
122146
# * create a PR

0 commit comments

Comments
 (0)