File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 1- name : Auto Tag and Release
1+ name : Auto Tag, Release on PR Merge
22on :
3- push :
3+ pull_request :
44 branches :
55 - ' main'
6+ types :
7+ - closed
8+
69permissions :
710 contents : write
11+
812jobs :
913 tag-and-release :
14+ if : github.event.pull_request.merged == true && github.head_ref == 'dev'
1015 runs-on : ubuntu-latest
1116 steps :
1217 - name : Checkout source code
1318 uses : actions/checkout@v4.0.0
1419 with :
1520 fetch-depth : 0
21+ ref : ' main' # Ensure we're tagging the main branch after the merge
22+
1623 - name : Configure Git
1724 run : |
1825 git config --local user.email "action@github.com"
1926 git config --local user.name "GitHub Action"
27+
2028 - name : Determine Next Version Tag
2129 id : nextver
2230 run : |
@@ -43,10 +51,12 @@ jobs:
4351 NEXT_TAG="v$MAJOR.$MINOR.$PATCH"
4452 echo "Next version tag: $NEXT_TAG"
4553 echo "tag=$NEXT_TAG" >> $GITHUB_OUTPUT
54+
4655 - name : Create and Push Tag
4756 run : |
4857 git tag ${{ steps.nextver.outputs.tag }}
4958 git push origin ${{ steps.nextver.outputs.tag }}
59+
5060 - name : Create Release with Automated Release Notes
5161 uses : softprops/action-gh-release@v0.1.15
5262 with :
You can’t perform that action at this time.
0 commit comments