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 : Create Version Tag
2+
3+ on :
4+ workflow_dispatch :
5+ push :
6+ paths :
7+ - ' lerna.json'
8+
9+ concurrency :
10+ group : " version-tag"
11+ cancel-in-progress : false
12+
13+ jobs :
14+ create-tag :
15+ runs-on : ubuntu-latest
16+ permissions :
17+ contents : write
18+ steps :
19+ - name : Checkout repository
20+ uses : actions/checkout@v6
21+ with :
22+ fetch-depth : 2
23+ token : ${{ secrets.GITHUB_TOKEN }}
24+
25+ - name : Check if version changed
26+ id : check_version
27+ run : |
28+ if git diff HEAD^ lerna.json | grep -q '^+.*"version":'; then
29+ echo "version_changed=true" >> $GITHUB_OUTPUT
30+ fi
31+
32+ - name : Create and push tag
33+ if : steps.check_version.outputs.version_changed == 'true'
34+ run : |
35+ VERSION=$(grep '"version":' lerna.json | sed 's/.*"version": "\([^"]*\)".*/\1/')
36+ TAG_NAME="v$VERSION"
37+
38+ git config --global user.name "${{ github.actor }}"
39+ git config --global user.email "${{ github.actor }}@users.noreply.github.com"
You can’t perform that action at this time.
0 commit comments