-
-
Notifications
You must be signed in to change notification settings - Fork 16
74 lines (62 loc) · 2.5 KB
/
sync-release-notes.yml
File metadata and controls
74 lines (62 loc) · 2.5 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
name: Sync Release Notes
# Manual-only trigger — automated changelog sync is handled by the Release workflow.
# Use this to re-sync CHANGELOG.md from GitHub releases at any time.
on:
workflow_dispatch:
permissions:
contents: read
jobs:
sync-release-notes:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0
with:
egress-policy: audit
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: '24.x'
- name: Sync GitHub release notes to CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: node scripts/sync-changelog.js
- name: Check for changes
id: changes
run: |
CHANGED=false
for f in vscode-extension/CHANGELOG.md cli/CHANGELOG.md visualstudio-extension/CHANGELOG.md; do
if [ -f "$f" ] && ! git diff --quiet "$f"; then
echo "Changes detected in $f"
CHANGED=true
fi
done
echo "changed=$CHANGED" >> "$GITHUB_OUTPUT"
- name: Create Pull Request
if: steps.changes.outputs.changed == 'true'
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
branch: update-changelogs
title: "docs: sync per-project CHANGELOG files with GitHub release notes"
body: |
Automatically syncs per-project CHANGELOG files with the latest GitHub release notes.
Updated files (if changed):
- `vscode-extension/CHANGELOG.md`
- `cli/CHANGELOG.md`
- `visualstudio-extension/CHANGELOG.md`
Triggered by: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
commit-message: "docs: sync per-project CHANGELOG files with GitHub release notes"
- name: Summary
run: |
if [ "${{ steps.changes.outputs.changed }}" == "true" ]; then
echo "✅ A PR has been created to update per-project CHANGELOG files with GitHub release notes"
else
echo "ℹ️ All CHANGELOG files were already up to date with GitHub release notes"
fi