Skip to content

Commit 986b6b7

Browse files
authored
Add release tag actions (#25)
* Create add-tag.yml * Update add-tag.yml * Update add-tag.yml
1 parent 9cc7c10 commit 986b6b7

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/add-tag.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Add git tag
2+
on:
3+
pull_request:
4+
types: [closed]
5+
jobs:
6+
release-candidate:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: checkout
10+
uses: actions/checkout@v2
11+
- name: Add tag
12+
if: startsWith(github.event.pull_request.title, 'Release') && github.event.pull_request.merged == true
13+
env:
14+
PR_TITLE: ${{ github.event.pull_request.title }}
15+
run: |
16+
echo $PR_TITLE | grep -e "Release.*" || exit 1
17+
git remote set-url origin https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
18+
git tag $(echo $PR_TITLE | sed -E 's/.* ([0-9\-\.]*)/\1/g')
19+
git tag -l
20+
git push origin -f --tags

0 commit comments

Comments
 (0)