BugFix: Fix Pipeline Issue #18
Workflow file for this run
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
# Switch to Draft | |
# Scales down running PODS when switching to Draft | |
name: Draft Scale Down | |
on: | |
pull_request: | |
types: [converted_to_draft] | |
jobs: | |
scaleDownPods: | |
name: Scale down the pods for this PR | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
env: | |
PR_NUMBER: ${{ github.event.number }} | |
steps: | |
# Log in to OpenShift. | |
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK. | |
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail. | |
- name: Log in to OpenShift | |
run: oc login --token=${{ secrets.TOOLS_SA_TOKEN }} --server=https://api.silver.devops.gov.bc.ca:6443 | |
- name: Scale down | |
run: oc get deploymentconfig --namespace af2668-dev --selector env-id=$PR_NUMBER -o name | awk '{print "oc scale --replicas=0 " $1}' | bash |