Troubleshooting
Common issues and solutions for Commit Check GitHub Action.
Common Issues
Action Fails with “Permission denied”
Problem: The action fails with permission errors when trying to post PR comments.
Solution: Ensure you have the correct permissions in your workflow:
permissions:
contents: read
pull-requests: write # Required for PR comments
Action Doesn’t Work with Forked Repositories
Problem: PR comments feature doesn’t work when the PR comes from a forked repository.
Solution: This is a known limitation. Forked repositories have restricted permissions for security reasons. Use job-summary: true
instead:
- uses: commit-check/commit-check-action@v1
with:
pr-comments: false
job-summary: true
merge-base Check Fails
Problem: The merge-base check fails unexpectedly.
Solution: Ensure you’re fetching enough history:
- uses: actions/checkout@v5
with:
fetch-depth: 0 # Fetch all history
Custom Configuration Not Applied
Problem: Your .commit-check.yml
file is not being used.
Solution:
- Ensure the file is in the repository root
- Check the file syntax with a YAML validator
- Verify the file is committed and available in the checked-out branch
Action Times Out
Problem: The action takes too long and times out.
Solution:
- Use
fetch-depth: 1
if you don’t need merge-base checking - Consider using
dry-run: true
for debugging - Check if your regex patterns are too complex
Debug Mode
Enable debug mode by setting environment variables:
- uses: commit-check/commit-check-action@v1
env:
ACTIONS_STEP_DEBUG: true
with:
dry-run: true
Configuration Validation
Test your configuration locally:
# Install commit-check locally
pip install commit-check
# Test with your config
commit-check --config .commit-check.yml --dry-run --message --branch
Getting Help
If you’re still experiencing issues:
- Check the Issues page
- Search for similar problems in Discussions
- Create a new issue with:
- Your workflow YAML
- Error messages
- Example commits that fail