-
Notifications
You must be signed in to change notification settings - Fork 135
86 lines (75 loc) · 2.52 KB
/
shield-branch-updater.yaml
File metadata and controls
86 lines (75 loc) · 2.52 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Shield Release Branch Updater
on:
workflow_dispatch:
inputs:
kind:
description: 'Shield component'
required: true
default: "cluster"
type: choice
options:
- "cluster"
- "host-windows"
- "host-linux"
latest_release_version:
description: 'Latest release version'
required: true
next_release_version:
description: 'Next release version'
required: true
permissions:
contents: write
env:
CURRENT_RELEASE_BRANCH: ${{ inputs.kind }}-shield-release-${{ inputs.latest_release_version}}
NEXT_RELEASE_BRANCH: ${{ inputs.kind }}-shield-release-${{ inputs.next_release_version}}
jobs:
update-current-release-branch:
runs-on: ubuntu-latest
steps:
- name: Checkout current release branch
id: checkout
uses: actions/checkout@v6
continue-on-error: true
with:
ref: ${{ env.CURRENT_RELEASE_BRANCH }}
fetch-depth: 0
- name: Checkout main branch
if: steps.checkout.outcome == 'failure'
uses: actions/checkout@v6
- name: Create current release branch
if: steps.checkout.outcome == 'failure'
run: |
git checkout -b ${{ env.CURRENT_RELEASE_BRANCH }}
git push -u origin ${{ env.CURRENT_RELEASE_BRANCH }}
- name: Update current release branch
if: steps.checkout.outcome == 'success'
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
./scripts/shield/rebase.sh
git push --force-with-lease
update-next-release-branch:
runs-on: ubuntu-latest
steps:
- name: Checkout next release branch
id: checkout
uses: actions/checkout@v6
continue-on-error: true
with:
ref: ${{ env.NEXT_RELEASE_BRANCH }}
fetch-depth: 0
- name: Checkout main branch
if: steps.checkout.outcome == 'failure'
uses: actions/checkout@v6
- name: Create next release branch
if: steps.checkout.outcome == 'failure'
run: |
git checkout -b ${{ env.NEXT_RELEASE_BRANCH }}
git push -u origin ${{ env.NEXT_RELEASE_BRANCH }}
- name: Update next release branch
if: steps.checkout.outcome == 'success'
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
./scripts/shield/rebase.sh
git push --force-with-lease