-
-
Notifications
You must be signed in to change notification settings - Fork 2
31 lines (26 loc) · 897 Bytes
/
version-update.yml
File metadata and controls
31 lines (26 loc) · 897 Bytes
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
name: Update App Version
permissions:
contents: write
on:
push:
branches: ["main"]
jobs:
sync-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: true
- name: Read version from package.json
id: get_version
run: |
VERSION=$(node -p "require('./app/package.json').version")
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Update manifest.json
run: |
echo "{\"version\":\"${{ steps.get_version.outputs.version }}\"}" > app/static/manifest.json
git config user.name "github-actions"
git config user.email "actions@github.com"
git add app/static/manifest.json
git diff --cached --quiet || git commit -m "Sync manifest.json version to ${{ steps.get_version.outputs.version }} [skip ci]"
git push