-
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (31 loc) · 934 Bytes
/
create-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
35
36
37
name: Publish release
on:
pull_request:
types:
- closed
branches:
- main
permissions:
contents: write
id-token: write
jobs:
create-tag:
name: Create tag
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'new-release')
outputs:
tag-name: ${{ steps.prepare-tag.outputs.tag-name }}
steps:
- name: Parse tag
id: prepare-tag
run: |
branch_name="${{ github.event.pull_request.head.ref }}"
tag_name=$(echo $branch_name | sed 's/version\///')
echo "tag-name=$tag_name" >> $GITHUB_OUTPUT
- name: Checkout branch
uses: actions/checkout@v4
- name: Create tag
run: |
git tag "${{ steps.prepare-tag.outputs.tag-name }}"
- name: Push tag to origin
run: git push origin "${{ steps.prepare-tag.outputs.tag-name }}"