Skip to content

Promote branch

Promote branch #6

---
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: |
If passed with value true, allow promotion to staging even if staging and production differ
type: boolean
required: true
default: false
override:
description: |
If passed with value true, 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: |
If passed with value true, 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@v3
- 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 }}