-
Notifications
You must be signed in to change notification settings - Fork 74
44 lines (36 loc) · 1.06 KB
/
update-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
38
39
40
41
42
43
44
name: Workflow for Release
on:
push:
tags:
- 'release/v*'
- 'hotfix/v*'
jobs:
sync-release-branch:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.WORKFLOW_TOKEN }}
- name: Fetch all history
run: git fetch --unshallow || git fetch --all
- name: Determine Tag Type
id: tagtype
run: |
if [[ ${{ github.ref }} == refs/tags/release/v* ]]; then
echo "::set-output name=type::release"
elif [[ ${{ github.ref }} == refs/tags/hotfix/v* ]]; then
echo "::set-output name=type::hotfix"
fi
- name: Check out the release branch
run: |
git checkout release || git checkout -b release
- name: Sync release branch to tag
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
run: |
git reset --hard ${{ github.ref }}
git push -f origin release