-
Notifications
You must be signed in to change notification settings - Fork 52
49 lines (49 loc) · 1.45 KB
/
promote_branch.yaml
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
---
name: Promote branch
on:
workflow_dispatch:
inputs:
target-branch:
description: The name of the branch to be promoted
type: choice
required: true
default: staging
options:
- staging
- production
force-to-staging:
description: |
Force to staging: Allow promotion to staging even if staging and production differ
type: boolean
required: true
default: false
override:
description: |
Override: Allow promotion to production even if the change has not been in staging for one
week
type: boolean
required: true
default: false
dry-run:
description: |
Dry run: Print out the changes that would be promoted but do not perform the git push
type: boolean
required: true
default: false
jobs:
promote-branch:
name: Promote Branch
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run branch promotion script
run: |
.github/scripts/promote_branch.sh --target-branch $TARGET --force-to-staging $FORCE \
--override $OVERRIDE --dry-run $DRY
env:
TARGET: ${{ inputs.target-branch }}
FORCE: ${{ inputs.force-to-staging }}
OVERRIDE: ${{ inputs.override }}
DRY: ${{ inputs.dry-run }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}