-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (30 loc) · 979 Bytes
/
push-tag.yaml
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
name: tag push
on:
pull_request:
branches:
- 'main'
types:
- closed
jobs:
push-tag:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')
steps:
- name: Generate GitHub Apps token
id: generate
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.generate.outputs.token }}
- name: push tag
run: |
BRANCH_NAME=${{ github.event.pull_request.head.ref }}
TAG=${BRANCH_NAME##*/}
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git tag -a -m "Release $TAG" $TAG
git push origin $TAG