File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments