Skip to content

Commit 40843a9

Browse files
committed
added promote branch wf
1 parent 6cdbc92 commit 40843a9

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: 'Promote branch'
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
promotion-type:
7+
type: choice
8+
options:
9+
- 'release'
10+
- 'preview'
11+
description: 'Target branch to create.'
12+
required: true
13+
14+
permissions:
15+
actions: read
16+
id-token: write
17+
contents: write
18+
19+
concurrency:
20+
group: 'promote-branch-${{ inputs.promotion-type }}-${{ github.head_ref || github.ref }}'
21+
cancel-in-progress: false
22+
23+
env:
24+
dotnet-sdk-version: '9.x'
25+
is-development-branch: ${{ startsWith(github.ref_name, 'develop') }}
26+
is-maintenance-branch: ${{ startsWith(github.ref_name, 'support') }}
27+
28+
jobs:
29+
validate-promotion:
30+
name: 'Validate promotion'
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: 'Check promotion type'
34+
run: |
35+
if [[ "${{ inputs.promotion-type }}" != "release" && "${{ inputs.promotion-type }}" != "preview" ]]; then
36+
echo "Invalid promotion type: ${{ inputs.promotion-type }}"
37+
exit 1
38+
fi
39+
- name: 'Check source branch'
40+
run: |
41+
if [[ "!${{ env.isdevelopment-branch }} || !${{ env.is-maintenance-branch }}" ]]; then
42+
echo "Source branch is required."
43+
exit 1
44+
fi

0 commit comments

Comments
 (0)