|
| 1 | +--- |
| 2 | +layout: default |
| 3 | +title: Troubleshooting - Commit Check Action |
| 4 | +permalink: /commit-check-action/troubleshooting/ |
| 5 | +--- |
| 6 | + |
| 7 | +# Troubleshooting |
| 8 | + |
| 9 | +Common issues and solutions for Commit Check GitHub Action. |
| 10 | + |
| 11 | +## Common Issues |
| 12 | + |
| 13 | +### Action Fails with "Permission denied" |
| 14 | + |
| 15 | +**Problem**: The action fails with permission errors when trying to post PR comments. |
| 16 | + |
| 17 | +**Solution**: Ensure you have the correct permissions in your workflow: |
| 18 | + |
| 19 | +```yaml |
| 20 | +permissions: |
| 21 | + contents: read |
| 22 | + pull-requests: write # Required for PR comments |
| 23 | +``` |
| 24 | +
|
| 25 | +### Action Doesn't Work with Forked Repositories |
| 26 | +
|
| 27 | +**Problem**: PR comments feature doesn't work when the PR comes from a forked repository. |
| 28 | +
|
| 29 | +**Solution**: This is a known limitation. Forked repositories have restricted permissions for security reasons. Use `job-summary: true` instead: |
| 30 | + |
| 31 | +```yaml |
| 32 | +- uses: commit-check/commit-check-action@v1 |
| 33 | + with: |
| 34 | + pr-comments: false |
| 35 | + job-summary: true |
| 36 | +``` |
| 37 | + |
| 38 | +### merge-base Check Fails |
| 39 | + |
| 40 | +**Problem**: The merge-base check fails unexpectedly. |
| 41 | + |
| 42 | +**Solution**: Ensure you're fetching enough history: |
| 43 | + |
| 44 | +```yaml |
| 45 | +- uses: actions/checkout@v5 |
| 46 | + with: |
| 47 | + fetch-depth: 0 # Fetch all history |
| 48 | +``` |
| 49 | + |
| 50 | +### Custom Configuration Not Applied |
| 51 | + |
| 52 | +**Problem**: Your `.commit-check.yml` file is not being used. |
| 53 | + |
| 54 | +**Solution**: |
| 55 | +1. Ensure the file is in the repository root |
| 56 | +2. Check the file syntax with a YAML validator |
| 57 | +3. Verify the file is committed and available in the checked-out branch |
| 58 | + |
| 59 | +### Action Times Out |
| 60 | + |
| 61 | +**Problem**: The action takes too long and times out. |
| 62 | + |
| 63 | +**Solution**: |
| 64 | +1. Use `fetch-depth: 1` if you don't need merge-base checking |
| 65 | +2. Consider using `dry-run: true` for debugging |
| 66 | +3. Check if your regex patterns are too complex |
| 67 | + |
| 68 | +## Debug Mode |
| 69 | + |
| 70 | +Enable debug mode by setting environment variables: |
| 71 | + |
| 72 | +```yaml |
| 73 | +- uses: commit-check/commit-check-action@v1 |
| 74 | + env: |
| 75 | + ACTIONS_STEP_DEBUG: true |
| 76 | + with: |
| 77 | + dry-run: true |
| 78 | +``` |
| 79 | + |
| 80 | +## Configuration Validation |
| 81 | + |
| 82 | +Test your configuration locally: |
| 83 | + |
| 84 | +```bash |
| 85 | +# Install commit-check locally |
| 86 | +pip install commit-check |
| 87 | +
|
| 88 | +# Test with your config |
| 89 | +commit-check --config .commit-check.yml --dry-run --message --branch |
| 90 | +``` |
| 91 | + |
| 92 | +## Getting Help |
| 93 | + |
| 94 | +If you're still experiencing issues: |
| 95 | + |
| 96 | +1. Check the [Issues](https://github.com/commit-check/commit-check/issues) page |
| 97 | +2. Search for similar problems in [Discussions](https://github.com/commit-check/commit-check/discussions) |
| 98 | +3. Create a new issue with: |
| 99 | + - Your workflow YAML |
| 100 | + - Error messages |
| 101 | + - Example commits that fail |
| 102 | + |
| 103 | +[← Back to GitHub Action Documentation](../) |
0 commit comments