generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 0
28 lines (24 loc) · 898 Bytes
/
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
name: Release
on:
release:
types: [published]
jobs:
release:
name: Add Major & Minor Git Tag
if: github.event.release.prerelease == false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Get Major & Minor version
id: version
run: |
echo "major=$(echo ${{ github.event.release.tag_name }} | cut -d. -f1)" >> $GITHUB_OUTPUT
echo "minor=$(echo ${{ github.event.release.tag_name }} | cut -d. -f2)" >> $GITHUB_OUTPUT
- name: Push Git Tag (Major, Minor)
run: |
git config user.name ${{ vars.GH_ACTIONS_COMMIT_NAME }}
git config user.email ${{ vars.GH_ACTIONS_COMMIT_EMAIL }}
git tag ${{ steps.version.outputs.major }}
git tag ${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}
git push --tags --force