promote-dev-to-messy #15642
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: promote-dev-to-messy | |
on: | |
schedule: | |
- cron: '15 * * * *' | |
workflow_dispatch: | |
inputs: | |
dry-run: | |
description: 'Dry run' | |
required: false | |
default: 'false' | |
type: choice | |
options: | |
- "true" | |
- "false" | |
auto-merge: | |
description: 'Auto merge' | |
required: false | |
default: 'false' | |
type: choice | |
options: | |
- "true" | |
- "false" | |
push: | |
tags: | |
- 'v*-rc*' # e.g. v1.0-rc1, v20.15.10-rc5 | |
jobs: | |
promote-dev-to-messy: | |
name: Promote dev to messy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/checkout@v3 | |
with: | |
# fetch-depth: 0 needed to get all branches | |
fetch-depth: 0 | |
path: test-deploy | |
token: ${{ secrets.PUSHER_ROBOT_GITHUB_TOKEN }} | |
- name: Set ENV | |
run: | | |
# Generate unique EOF value to prevent injection attack | |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) | |
echo "IMAGES<<$EOF" >> $GITHUB_ENV | |
cat .github/config/promote/dev-to-messy.json >> $GITHUB_ENV | |
echo "$EOF" >> $GITHUB_ENV | |
- name: Promote (workflow_dispatch) | |
uses: kustomize-everything/[email protected] | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
with: | |
target-repo: kustomize-everything/test-deploy | |
target-branch: main | |
working-directory: test-deploy | |
images: ${{ env.IMAGES }} | |
github-token: ${{ secrets.PUSHER_ROBOT_GITHUB_TOKEN }} | |
promotion-method: pull_request | |
dry-run: ${{ inputs.dry-run }} | |
auto-merge: ${{ inputs.auto-merge }} | |
- name: Promote (scheduled) | |
uses: kustomize-everything/[email protected] | |
if: ${{ github.event_name == 'schedule' }} | |
with: | |
target-repo: kustomize-everything/test-deploy | |
target-branch: main | |
working-directory: test-deploy | |
images: ${{ env.IMAGES }} | |
github-token: ${{ secrets.PUSHER_ROBOT_GITHUB_TOKEN }} | |
promotion-method: pull_request | |
dry-run: false | |
auto-merge: false |