-
Notifications
You must be signed in to change notification settings - Fork 3.6k
96 lines (93 loc) · 2.78 KB
/
Copy pathrelease-notes-preview.yml
File metadata and controls
96 lines (93 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
name: Generate Release Notes Preview
on:
workflow_dispatch:
inputs:
from_ref:
description: >
Start ref (excluded from range). Use a tag like v0.57.18, a commit
SHA, "main", or "latest-release" to resolve the most recent GitHub
Release tag.
required: false
default: latest-release
type: string
to_ref:
description: >
End ref (included in range). Use a tag like v0.57.19-staging, a
commit SHA, "main", or "latest-tag" to resolve the most recent git
tag.
required: false
default: main
type: string
use_ai:
description: Use OpenAI to polish the notes (requires OPENAI_API_KEY secret).
required: false
type: boolean
default: true
model:
description: OpenAI model to use (ignored when use_ai is false).
required: false
type: choice
default: gpt-5.2
options:
- gpt-5.2
- gpt-4.1
- o3
permissions:
contents: read
concurrency:
group: release-notes-preview
cancel-in-progress: true
jobs:
generate:
name: Generate Release Notes
runs-on: ubuntu-latest
environment: Production
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 24
- name: Generate notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
set -euo pipefail
ARGS=(
--from "${{ inputs.from_ref }}"
--to "${{ inputs.to_ref }}"
--repo "$GITHUB_REPOSITORY"
--output release-notes-preview.md
)
if [ "${{ inputs.use_ai }}" = "true" ]; then
if [ -z "${OPENAI_API_KEY:-}" ]; then
echo "::error::OPENAI_API_KEY secret is required when use_ai is enabled."
exit 1
fi
ARGS+=(--model "${{ inputs.model }}")
else
ARGS+=(--no-ai)
fi
node scripts/release/generate-release-notes.mjs "${ARGS[@]}"
- name: Upload as artifact
uses: actions/upload-artifact@v7
with:
name: release-notes-preview
path: release-notes-preview.md
retention-days: 30
- name: Print to job summary
run: |
{
echo "## Release Notes Preview"
echo ""
echo "**Range:** \`${{ inputs.from_ref }}\` → \`${{ inputs.to_ref }}\`"
echo "**AI:** ${{ inputs.use_ai }}"
echo ""
cat release-notes-preview.md
} >> "$GITHUB_STEP_SUMMARY"