Skip to content

Commit 4135da9

Browse files
committed
feat: add workflow for creating tags on merged pull requests
1 parent 8cc10f4 commit 4135da9

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/create-tag.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: "(Tag): Create"
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
branches:
7+
- core
8+
9+
jobs:
10+
create-tag:
11+
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'tag/v')
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout main
15+
uses: actions/checkout@v4
16+
with:
17+
ref: core
18+
19+
- name: Get version from package.json
20+
id: version
21+
run: |
22+
echo "tag=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
23+
24+
- name: Create tag
25+
run: |
26+
git config user.name "code-snippets-bot"
27+
git config user.email "sre@codesnippets.pro"
28+
git tag "v${{ steps.version.outputs.tag }}"
29+
git push origin "v${{ steps.version.outputs.tag }}"

0 commit comments

Comments
 (0)