-
Notifications
You must be signed in to change notification settings - Fork 248
57 lines (51 loc) · 1.62 KB
/
generate-release-notes.yml
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
name: generate release notes
on:
pull_request:
types: [opened, synchronize]
paths:
- "**/src/*.yml"
- "**/src/*.yaml"
jobs:
release-notes:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
path: content
sparse-checkout: |
advocacy_docs
product_docs
- name: Checkout relgen tool
uses: actions/checkout@v4
with:
ref: develop
path: tools
sparse-checkout: |
tools
- name: setup node
uses: actions/setup-node@v4
- name: install dependencies
run: npm --prefix ./tools/tools/automation/generators/relgen ci
# TODO: limit this to paths that have actually *changed*
- name: regenerate relnotes
run: |
shopt -s globstar
for rnmetapath in ./content/**/src/meta.yml; do
./tools/tools/automation/generators/relgen/relgen.js -p ${rnmetapath%/src/meta.yml}
done
- name: check for modified files
id: changes
run: |
cd ./content
echo "files=`git ls-files --other --modified --exclude-standard | wc -l`" >> $GITHUB_OUTPUT
- name: commit modified files
if: steps.changes.outputs.files > 0
run: |
cd ./content
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "update generated release notes"
git push