Skip to content

Commit 151287d

Browse files
Copilotshenxianpeng
andcommitted
docs: Add configuration guide, troubleshooting, quick start, and enhanced styling
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
1 parent 2596bc4 commit 151287d

File tree

10 files changed

+576
-2
lines changed

10 files changed

+576
-2
lines changed

_config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ plugins:
1313
- jekyll-feed
1414
- jekyll-sitemap
1515

16+
# Sass configuration
17+
sass:
18+
style: compressed
19+
1620
# Social links
1721
github_username: commit-check
1822

_includes/navigation.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<nav class="site-nav">
22
<a href="{{ '/' | relative_url }}" {% if page.url == '/' %}class="current"{% endif %}>Home</a>
3+
<a href="{{ '/quick-start/' | relative_url }}" {% if page.url contains '/quick-start/' %}class="current"{% endif %}>Quick Start</a>
34
<a href="{{ '/commit-check/' | relative_url }}" {% if page.url contains '/commit-check/' %}class="current"{% endif %}>Commit Check Tool</a>
45
<a href="{{ '/commit-check-action/' | relative_url }}" {% if page.url contains '/commit-check-action/' %}class="current"{% endif %}>GitHub Action</a>
56
<a href="https://github.com/commit-check" target="_blank">GitHub</a>

_layouts/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<title>{% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %}</title>
99
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
1010

11-
<link rel="stylesheet" href="{{ '/assets/main.css' | relative_url }}">
11+
<link rel="stylesheet" href="{{ '/assets/css/main.css' | relative_url }}">
1212
<link rel="canonical" href="{{ page.url | replace:'index.html','' | absolute_url }}">
1313

1414
<style>

assets/css/main.scss

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
---
2+
---
3+
4+
/* Base styles */
5+
body {
6+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
7+
line-height: 1.6;
8+
color: #333;
9+
margin: 0;
10+
padding: 0;
11+
}
12+
13+
/* Code styling */
14+
pre, code {
15+
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
16+
background-color: #f6f8fa;
17+
border-radius: 6px;
18+
}
19+
20+
pre {
21+
padding: 16px;
22+
overflow: auto;
23+
border: 1px solid #e1e4e8;
24+
}
25+
26+
code {
27+
padding: 0.2em 0.4em;
28+
font-size: 85%;
29+
}
30+
31+
pre code {
32+
padding: 0;
33+
background-color: transparent;
34+
}
35+
36+
/* Links */
37+
a {
38+
color: #0366d6;
39+
text-decoration: none;
40+
}
41+
42+
a:hover {
43+
text-decoration: underline;
44+
}
45+
46+
/* Headers */
47+
h1, h2, h3, h4, h5, h6 {
48+
margin-top: 24px;
49+
margin-bottom: 16px;
50+
font-weight: 600;
51+
line-height: 1.25;
52+
}
53+
54+
h1 {
55+
font-size: 2em;
56+
border-bottom: 1px solid #eaecef;
57+
padding-bottom: 0.3em;
58+
}
59+
60+
h2 {
61+
font-size: 1.5em;
62+
border-bottom: 1px solid #eaecef;
63+
padding-bottom: 0.3em;
64+
}
65+
66+
/* Lists */
67+
ul, ol {
68+
padding-left: 2em;
69+
}
70+
71+
/* Tables */
72+
table {
73+
border-collapse: collapse;
74+
width: 100%;
75+
margin: 16px 0;
76+
}
77+
78+
th, td {
79+
border: 1px solid #dfe2e5;
80+
padding: 6px 13px;
81+
}
82+
83+
th {
84+
background-color: #f6f8fa;
85+
font-weight: 600;
86+
}
87+
88+
/* Blockquotes */
89+
blockquote {
90+
padding: 0 1em;
91+
color: #6a737d;
92+
border-left: 0.25em solid #dfe2e5;
93+
margin: 0;
94+
}
95+
96+
/* Badges */
97+
img[alt*="badge"] {
98+
margin-right: 4px;
99+
margin-bottom: 4px;
100+
}
101+
102+
/* Navigation improvements */
103+
.site-nav a {
104+
padding: 8px 16px;
105+
border-radius: 6px;
106+
transition: background-color 0.2s;
107+
}
108+
109+
.site-nav a:hover {
110+
background-color: #f1f3f4;
111+
text-decoration: none;
112+
}
113+
114+
.site-nav a.current {
115+
background-color: #e1f5fe;
116+
}

commit-check-action/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,10 @@ jobs:
257257

258258
Versioning follows [Semantic Versioning](https://semver.org/).
259259

260+
## Troubleshooting
261+
262+
Having issues? Check out our [Troubleshooting Guide](troubleshooting/) for common problems and solutions.
263+
260264
## Have questions or feedback?
261265

262266
To provide feedback (requesting a feature or reporting a bug), please post to [issues](https://github.com/commit-check/commit-check/issues).
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
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

Comments
 (0)