-
Notifications
You must be signed in to change notification settings - Fork 5
46 lines (38 loc) · 1.2 KB
/
CI-merge-change-log.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
name: "Merge Change Log"
on:
pull_request_target:
types:
- closed
jobs:
merge:
if: github.event.pull_request.merged
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.PAT }}
- uses: actions/setup-node@v3
with:
cache: 'npm'
node-version: '20'
registry-url: 'https://registry.npmjs.org'
scope: '@sjcrh'
- name: Detect changes
run: |
NOTES=$(node ./build/changeLogGenerator.js)
if [[ "$NOTES" != "" ]]; then
echo "$NOTES" > CHANGELOG.md
fi
if [[ "$(git diff --name-only CHANGELOG.md)" == "CHANGELOG.md" ]]; then
git add CHANGELOG.md
if [[ -s release.txt ]]; then
echo '' > release.txt
git add release.txt
fi
git config --global user.email "[email protected]"
git config --global user.name "PPTeam CI"
git commit -m "append release notes to change log"
BRANCH=$(git rev-parse --abbrev-ref HEAD)
git pull --rebase
git push origin $BRANCH
fi