-
-
Notifications
You must be signed in to change notification settings - Fork 11
34 lines (33 loc) · 1.11 KB
/
changelog.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
name: changelog generation
# Only trigger on pull request closed events
on:
pull_request:
types: [closed]
jobs:
debug:
runs-on: ubuntu-latest
steps:
- uses: hmarr/debug-action@v2
changelog:
# This job will only run if a PR has been merged or a tag has been created
if: ${{ github.base_ref == 'v4/latest' && github.event.pull_request && github.event.pull_request.merged == true }}
runs-on: ubuntu-latest
steps:
- name: Checking out repository
uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: Generating changelog
env:
BASE_REF: ${{ github.base_ref }}
run: |
# Get the originating branch
BRANCH=$(git branch -r --contains $BASE_REF | sed "s/^\s*origin\///")
git checkout $BRANCH
npm i
node bin/changelog
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "GitHub Actions Bot"
git add .
git commit -m ":memo: Add CHANGELOG"
git push --set-upstream origin $BRANCH