File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Create Tag on Release Branch Merge
2+
3+ on :
4+ pull_request :
5+ types : [closed]
6+ branches :
7+ - main
8+ - dev_test
9+
10+ jobs :
11+ create-tag :
12+ if : github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout code
16+ uses : actions/checkout@v3
17+ with :
18+ fetch-depth : 0
19+
20+ - name : Extract version from branch name
21+ id : extract-version
22+ run : |
23+ BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
24+ VERSION=${BRANCH_NAME#release/}
25+ echo "VERSION=$VERSION" >> $GITHUB_ENV
26+ echo "Extracted version: $VERSION"
27+
28+ - name : Create and push tag
29+ run : |
30+ git config --local user.email "[email protected] " 31+ git config --local user.name "GitHub Action"
32+ git tag -a "v${{ env.VERSION }}" -m "Release v${{ env.VERSION }}"
33+ git push origin "v${{ env.VERSION }}"
You can’t perform that action at this time.
0 commit comments