Skip to content

Commit 795e6e1

Browse files
authored
Merge pull request #31 from splitio/dev_test
Add CI step to main
2 parents dd3361a + 79150b5 commit 795e6e1

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Create Tag on Release Branch Merge
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
branches:
7+
- main
8+
- dev_test
9+
10+
jobs:
11+
create-tag:
12+
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Extract version from branch name
21+
id: extract-version
22+
run: |
23+
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
24+
VERSION=${BRANCH_NAME#release/}
25+
echo "VERSION=$VERSION" >> $GITHUB_ENV
26+
echo "Extracted version: $VERSION"
27+
28+
- name: Create and push tag
29+
run: |
30+
git config --local user.email "[email protected]"
31+
git config --local user.name "GitHub Action"
32+
git tag -a "${{ env.VERSION }}" -m "Release ${{ env.VERSION }}"
33+
git push origin "${{ env.VERSION }}"

0 commit comments

Comments
 (0)