This guide covers authentication requirements and best practices for using the Go Git Commit Action.
Starting from actions/checkout@v6, Git credentials are stored in the $RUNNER_TEMP directory, which is not accessible from Docker containers. You must provide the github_token input:
- uses: actions/checkout@v6
- uses: somaz94/go-git-commit-action@v1
with:
user_email: actions@github.com
user_name: GitHub Actions
github_token: ${{ secrets.PAT_TOKEN }} # Required!checkout@v6changed credential storage for security improvements- Docker containers cannot access
$RUNNER_TEMPdirectory - The action configures Git credentials using the provided token
Automatically provided by GitHub Actions. Use for:
- ✅ Standard commit/push operations
- ✅ Basic branch operations
- ❌ Tag operations (limited permissions)
- ❌ Workflow modifications (limited permissions)
github_token: ${{ secrets.GITHUB_TOKEN }}User-created token with custom permissions. Use for:
- ✅ Tag creation and deletion
- ✅ Workflow file modifications
- ✅ Cross-repository operations
- ✅ Pull request creation
github_token: ${{ secrets.PAT_TOKEN }}Required PAT Permissions:
repo(Full control of private repositories)workflow(Update GitHub Action workflows) - if modifying workflows
- uses: actions/checkout@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: somaz94/go-git-commit-action@v1
with:
user_email: actions@github.com
user_name: GitHub Actions
github_token: ${{ secrets.GITHUB_TOKEN }} # Required for checkout@v6- uses: actions/checkout@v6
with:
token: ${{ secrets.PAT_TOKEN }} # PAT required for tags
- uses: somaz94/go-git-commit-action@v1
with:
user_email: actions@github.com
user_name: GitHub Actions
tag_name: v1.0.0
github_token: ${{ secrets.PAT_TOKEN }}- uses: actions/checkout@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: somaz94/go-git-commit-action@v1
with:
user_email: actions@github.com
user_name: GitHub Actions
create_pr: true
pr_branch: feature
pr_base: main
github_token: ${{ secrets.GITHUB_TOKEN }} # Required for PR- uses: actions/checkout@v6
with:
token: ${{ secrets.PAT_TOKEN }}
- uses: somaz94/go-git-commit-action@v1
with:
user_email: actions@github.com
user_name: GitHub Actions
github_token: ${{ secrets.PAT_TOKEN }} # Always required with v6| Operation | Recommended Token |
|---|---|
| Commit & Push | GITHUB_TOKEN |
| Tag Management | PAT_TOKEN |
| PR Creation | GITHUB_TOKEN or PAT_TOKEN |
| Workflow Modifications | PAT_TOKEN |
✅ Do:
- Store tokens as repository secrets
- Use the least privileged token for the job
- Rotate PATs regularly
❌ Don't:
- Hardcode tokens in workflow files
- Use PAT when GITHUB_TOKEN is sufficient
- Share tokens across different repositories unnecessarily
| Version | Token Required | Notes |
|---|---|---|
| checkout@v5 | Optional | Works without explicit token for basic operations |
| checkout@v6 | Required | Must provide token for Docker actions |
If you encounter authentication errors:
- Verify token is provided when using checkout@v6
- Check token permissions for tag/workflow operations
- Ensure token is not expired for PATs
- Verify secret name matches in workflow file
- Go to GitHub Settings → Developer settings → Personal access tokens
- Click "Generate new token (classic)"
- Select scopes:
- ✅
repo- Full control of private repositories - ✅
workflow- Update GitHub Action workflows (if needed)
- ✅
- Generate and copy the token
- Add to repository secrets as
PAT_TOKEN
Solution: Provide github_token input, especially with checkout@v6
github_token: ${{ secrets.GITHUB_TOKEN }}Solution: Use PAT instead of GITHUB_TOKEN
# In checkout step
token: ${{ secrets.PAT_TOKEN }}Solution: Ensure token has repo scope