-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (36 loc) · 1.21 KB
/
release.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
name: Upgrade Version After Merge
on:
pull_request:
types:
- closed
jobs:
version-upgrade:
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: yarn install
- name: Fetch Previous Commit's token-list.json
run: |
echo "Current Git branch: $(git rev-parse --abbrev-ref HEAD)"
echo "Fetching token-list.json from previous commit:"
git show HEAD~1:src/token-list.json > src/base-token-list.json
- name: Calculate Version Upgrade
run: yarn versionUpgrade
- name: Commit and Push Version Update
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add src/token-list.json
git commit -m "chore: bump token list version"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}