File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : " vTagBot"
2+
3+ on :
4+ release :
5+ types : [released, edited]
6+
7+ jobs :
8+ sync-version :
9+ runs-on : ubuntu-latest
10+
11+ permissions :
12+ contents : write
13+
14+ steps :
15+ - name : Checkout repository
16+ uses : actions/checkout@v4
17+
18+ - name : Extract release tag
19+ run : echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
20+
21+ - name : Update package.json version
22+ run : |
23+ TAG="${RELEASE_TAG#v}" # remove leading "v"
24+ echo "Updating version to $TAG"
25+ jq ".version = \"$TAG\"" package.json > package.tmp.json
26+ mv package.tmp.json package.json
27+
28+ - name : Commit and push changes
29+ run : |
30+ git config user.name "vTagBot"
31+ git config user.email "actions@github.com"
32+ git add package.json
33+ git commit -m "chore: sync version to $RELEASE_TAG" || echo "No changes to commit"
34+ git push
You can’t perform that action at this time.
0 commit comments