Skip to content

Commit b8349aa

Browse files
committed
📝 Add comprehensive GitHub Action documentation page
Create dedicated reference documentation for the GitHub Action with: - Quick start example and complete input/output reference tables - Detailed examples for release notes generation, changelog updates, and usage with OpenAI, Anthropic, and Google providers - Custom instructions, output handling, and version pinning examples - Platform compatibility matrix and tips for fetch depth, secrets management, and source builds Update VitePress sidebar navigation to include the new page under Reference. Fix README link to point to the new documentation location instead of the CLI reference anchor.
1 parent 4709386 commit b8349aa

File tree

3 files changed

+255
-1
lines changed

3 files changed

+255
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ Automate release notes and changelogs in your CI/CD:
140140
output-file: RELEASE_NOTES.md
141141
```
142142
143-
See the [GitHub Action documentation](https://hyperb1iss.github.io/git-iris/reference/cli#github-action) for all options.
143+
See the [GitHub Action documentation](https://hyperb1iss.github.io/git-iris/reference/github-action) for all options.
144144
145145
## 📚 Documentation
146146

docs/.vitepress/config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export default defineConfig({
3232
text: 'Reference',
3333
items: [
3434
{ text: 'CLI Reference', link: '/reference/cli' },
35+
{ text: 'GitHub Action', link: '/reference/github-action' },
3536
{ text: 'Keybindings', link: '/reference/keybindings' },
3637
{ text: 'Tokens', link: '/reference/tokens' },
3738
{ text: 'Troubleshooting', link: '/reference/troubleshooting' },
@@ -151,6 +152,7 @@ export default defineConfig({
151152
text: 'Reference',
152153
items: [
153154
{ text: 'CLI Commands', link: '/reference/cli' },
155+
{ text: 'GitHub Action', link: '/reference/github-action' },
154156
{ text: 'Keybindings', link: '/reference/keybindings' },
155157
{ text: 'Tokens', link: '/reference/tokens' },
156158
{ text: 'Troubleshooting', link: '/reference/troubleshooting' },

docs/reference/github-action.md

Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
# GitHub Action
2+
3+
Git-Iris is available as a GitHub Action for automating release notes, changelogs, and other Git artifacts directly in your CI/CD pipelines.
4+
5+
## Quick Start
6+
7+
```yaml
8+
- name: Generate Release Notes
9+
uses: hyperb1iss/git-iris@v2
10+
with:
11+
command: release-notes
12+
from: v1.0.0
13+
to: v2.0.0
14+
provider: anthropic
15+
api-key: ${{ secrets.ANTHROPIC_API_KEY }}
16+
output-file: RELEASE_NOTES.md
17+
```
18+
19+
## Inputs
20+
21+
| Input | Description | Required | Default |
22+
|-------|-------------|----------|---------|
23+
| `command` | Command to run: `release-notes`, `changelog` | No | `release-notes` |
24+
| `from` | Starting Git reference (tag, commit, or branch) | **Yes** | - |
25+
| `to` | Ending Git reference | No | `HEAD` |
26+
| `provider` | LLM provider: `openai`, `anthropic`, `google` | No | `openai` |
27+
| `model` | Model to use (provider-specific) | No | Provider default |
28+
| `api-key` | API key for the LLM provider | **Yes** | - |
29+
| `output-file` | File path to write output | No | - |
30+
| `version-name` | Explicit version name to use in output | No | - |
31+
| `custom-instructions` | Custom instructions for generation | No | - |
32+
| `update-file` | Prepend to existing file (changelog only) | No | `false` |
33+
| `version` | Git-Iris version to use | No | `latest` |
34+
| `build-from-source` | Build from source instead of binary | No | `false` |
35+
| `binary-path` | Path to pre-built binary | No | - |
36+
37+
## Outputs
38+
39+
| Output | Description |
40+
|--------|-------------|
41+
| `content` | Generated content as a string |
42+
| `output-file` | Path to the output file (if specified) |
43+
44+
## Examples
45+
46+
### Generate Release Notes for a Tag
47+
48+
```yaml
49+
name: Release
50+
51+
on:
52+
push:
53+
tags:
54+
- 'v*'
55+
56+
jobs:
57+
release:
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/checkout@v4
61+
with:
62+
fetch-depth: 0
63+
64+
- name: Get previous tag
65+
id: prev_tag
66+
run: |
67+
PREV=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
68+
echo "tag=$PREV" >> $GITHUB_OUTPUT
69+
70+
- name: Generate Release Notes
71+
id: notes
72+
uses: hyperb1iss/git-iris@v2
73+
with:
74+
command: release-notes
75+
from: ${{ steps.prev_tag.outputs.tag }}
76+
to: ${{ github.ref_name }}
77+
version-name: ${{ github.ref_name }}
78+
provider: anthropic
79+
model: claude-sonnet-4-5-20250929
80+
api-key: ${{ secrets.ANTHROPIC_API_KEY }}
81+
output-file: RELEASE_NOTES.md
82+
83+
- name: Create GitHub Release
84+
uses: softprops/action-gh-release@v2
85+
with:
86+
body_path: RELEASE_NOTES.md
87+
```
88+
89+
### Update CHANGELOG.md
90+
91+
```yaml
92+
- name: Update Changelog
93+
uses: hyperb1iss/git-iris@v2
94+
with:
95+
command: changelog
96+
from: v1.0.0
97+
to: HEAD
98+
version-name: "2.0.0"
99+
provider: openai
100+
api-key: ${{ secrets.OPENAI_API_KEY }}
101+
output-file: CHANGELOG.md
102+
update-file: "true" # Prepends to existing CHANGELOG.md
103+
```
104+
105+
### Use with Different Providers
106+
107+
#### OpenAI
108+
109+
```yaml
110+
- uses: hyperb1iss/git-iris@v2
111+
with:
112+
command: release-notes
113+
from: v1.0.0
114+
provider: openai
115+
model: gpt-4o
116+
api-key: ${{ secrets.OPENAI_API_KEY }}
117+
```
118+
119+
#### Anthropic
120+
121+
```yaml
122+
- uses: hyperb1iss/git-iris@v2
123+
with:
124+
command: release-notes
125+
from: v1.0.0
126+
provider: anthropic
127+
model: claude-sonnet-4-5-20250929
128+
api-key: ${{ secrets.ANTHROPIC_API_KEY }}
129+
```
130+
131+
#### Google
132+
133+
```yaml
134+
- uses: hyperb1iss/git-iris@v2
135+
with:
136+
command: release-notes
137+
from: v1.0.0
138+
provider: google
139+
model: gemini-2.0-flash
140+
api-key: ${{ secrets.GOOGLE_API_KEY }}
141+
```
142+
143+
### Custom Instructions
144+
145+
```yaml
146+
- uses: hyperb1iss/git-iris@v2
147+
with:
148+
command: release-notes
149+
from: v1.0.0
150+
provider: anthropic
151+
api-key: ${{ secrets.ANTHROPIC_API_KEY }}
152+
custom-instructions: |
153+
Focus on user-facing changes.
154+
Use simple language suitable for non-technical users.
155+
Group changes by feature area.
156+
```
157+
158+
### Use Output in Subsequent Steps
159+
160+
```yaml
161+
- name: Generate Notes
162+
id: notes
163+
uses: hyperb1iss/git-iris@v2
164+
with:
165+
command: release-notes
166+
from: v1.0.0
167+
provider: anthropic
168+
api-key: ${{ secrets.ANTHROPIC_API_KEY }}
169+
170+
- name: Use Generated Content
171+
run: |
172+
echo "Generated content:"
173+
echo "${{ steps.notes.outputs.content }}"
174+
```
175+
176+
### Pin to Specific Version
177+
178+
```yaml
179+
- uses: hyperb1iss/git-iris@v2
180+
with:
181+
command: release-notes
182+
from: v1.0.0
183+
provider: anthropic
184+
api-key: ${{ secrets.ANTHROPIC_API_KEY }}
185+
version: v2.0.0 # Use specific git-iris version
186+
```
187+
188+
## Supported Platforms
189+
190+
The action automatically downloads the appropriate binary for your runner:
191+
192+
| Runner | Architecture | Binary |
193+
|--------|--------------|--------|
194+
| `ubuntu-latest` | x64 | `git-iris-linux-amd64` |
195+
| `ubuntu-24.04-arm` | ARM64 | `git-iris-linux-arm64` |
196+
| `macos-latest` | ARM64 | `git-iris-macos-arm64` |
197+
| `windows-latest` | x64 | `git-iris-windows-gnu.exe` |
198+
199+
## Tips
200+
201+
### Fetch Full History
202+
203+
The action needs access to the Git history between your `from` and `to` references:
204+
205+
```yaml
206+
- uses: actions/checkout@v4
207+
with:
208+
fetch-depth: 0 # Fetch all history for all tags and branches
209+
```
210+
211+
### Store API Keys Securely
212+
213+
Always use GitHub Secrets for API keys:
214+
215+
1. Go to your repository Settings > Secrets and variables > Actions
216+
2. Click "New repository secret"
217+
3. Add your provider's API key (e.g., `ANTHROPIC_API_KEY`)
218+
219+
### Build from Source (Advanced)
220+
221+
If you need the latest features or encounter issues with the binary:
222+
223+
```yaml
224+
- uses: hyperb1iss/git-iris@v2
225+
with:
226+
command: release-notes
227+
from: v1.0.0
228+
provider: anthropic
229+
api-key: ${{ secrets.ANTHROPIC_API_KEY }}
230+
build-from-source: "true"
231+
```
232+
233+
::: warning
234+
Building from source significantly increases workflow time (~2-3 minutes for compilation).
235+
:::
236+
237+
### Use Pre-built Binary
238+
239+
If you've already built git-iris in a previous step:
240+
241+
```yaml
242+
- name: Build git-iris
243+
run: cargo build --release
244+
245+
- uses: hyperb1iss/git-iris@v2
246+
with:
247+
command: release-notes
248+
from: v1.0.0
249+
provider: anthropic
250+
api-key: ${{ secrets.ANTHROPIC_API_KEY }}
251+
binary-path: ./target/release/git-iris
252+
```

0 commit comments

Comments
 (0)