-
Notifications
You must be signed in to change notification settings - Fork 155
34 lines (34 loc) · 1.14 KB
/
Tag-And-Release.yml
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
32
33
34
name: Tag & Note Release
on :
pull_request:
branches:
- main
types:
- closed
jobs:
CheckRelease:
runs-on: ubuntu-latest
steps:
- name: Check if merge is release branch
id: check-release
run: |
if [[ ${{ github.head_ref }} =~ ^release/([0-9]+\.[0-9]+\.[0-9]+$) ]]; then
echo "match=true" >> $GITHUB_OUTPUT
echo "version=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT
fi
- name: Tag if release branch
if: github.event.pull_request.merged != true || steps.check-release.outputs.match != 'true'
run: exit 1
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
fetch-depth: '0'
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: version bump to ${{ steps.check-release.outputs.version }}
tagging_message: '${{ steps.check-release.outputs.version }}'
- uses: ncipollo/release-action@v1
with:
tag: ${{ steps.check-release.outputs.version }}
prerelease: true
generateReleaseNotes: true