-
Notifications
You must be signed in to change notification settings - Fork 6
41 lines (34 loc) · 1.08 KB
/
update-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
35
36
37
38
39
40
41
name: Update Changelog on Merge
on:
pull_request:
types: [closed]
jobs:
update-changelog:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
# Step 1: Check out the repository
- name: Checkout repository
uses: actions/checkout@v4
# Step 2: Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
# Step 3: Install dependencies
- name: Install dependencies
run: npm install
# Step 4: Run the changelog updater script
- name: Update CHANGELOG.md
run: |
node update-changelog.js
# Step 5: Commit and push changes
- name: Commit and push changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add CHANGELOG.md
git commit -m "Update CHANGELOG.md for PR #${{ github.event.pull_request.number }}"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}