|
9 | 9 | # the actual branch that can be chosen on the UI is made irrelevant by further steps
|
10 | 10 | # because someone will forget one day to change it.
|
11 | 11 | from_branch:
|
12 |
| - description: "Select branch to release from ('release/x.y.z'. If `dev` is entered, a new release branch will be created from `dev`)" |
| 12 | + description: "Select branch to release from. Dev branch releases happen the first monday of the month. Otherwise, use bugfix." |
13 | 13 | required: true
|
| 14 | + type: choice |
| 15 | + default: 'bugfix' |
| 16 | + options: |
| 17 | + - bugfix |
| 18 | + - dev |
14 | 19 | release_number:
|
15 | 20 | description: "Release version (x.y.z format)"
|
16 | 21 | required: true
|
|
19 | 24 | create_pr:
|
20 | 25 | runs-on: ubuntu-latest
|
21 | 26 | steps:
|
| 27 | + - name: Validate proper bugfix branch release_number format is being used |
| 28 | + if: ${{ inputs.from_branch == 'bugfix' }} |
| 29 | + run: | |
| 30 | + # Expect the last octet in release_number to not be 0 |
| 31 | + echo "${{ inputs.release_number }}" | grep "^[0-9]*\.[0-9]*\.[1-9]$" |
| 32 | +
|
| 33 | + - name: Validate proper dev branch release_number format is being used |
| 34 | + if: ${{ inputs.from_branch == 'dev' }} |
| 35 | + run: | |
| 36 | + # Expect the last octet in release_number to not be 1-9 |
| 37 | + echo "${{ inputs.release_number }}" | grep "^[0-9]*\.[0-9]*\.0$" |
| 38 | +
|
22 | 39 | - id: Set-GitHub-org
|
23 | 40 | run: echo "GITHUB_ORG=${GITHUB_REPOSITORY%%/*}" >> $GITHUB_ENV
|
24 | 41 |
|
|
28 | 45 | ref: ${{ github.event.inputs.from_branch }}
|
29 | 46 |
|
30 | 47 | - name: Create release branch
|
31 |
| - if: ${{ !startsWith(github.event.inputs.from_branch, 'release/') }} |
32 | 48 | run: |
|
33 | 49 | echo "NEW_BRANCH=release/${{ github.event.inputs.release_number }}" >> $GITHUB_ENV
|
34 | 50 |
|
35 |
| - - name: Use existing release branch |
36 |
| - if: startsWith(github.event.inputs.from_branch, 'release/') |
37 |
| - run: | |
38 |
| - echo "NEW_BRANCH=${{ github.event.inputs.from_branch }}" >> $GITHUB_ENV |
39 |
| -
|
40 | 51 | - name: Configure git
|
41 | 52 | run: |
|
42 | 53 | git config --global user.name "${{ env.GIT_USERNAME }}"
|
|
0 commit comments