bcgov/OpenShift CLI (oc) Login and Runner

Action for running OpenShift (oc) commands and managing cronjobs. Supports conditional execution based on file changes and provides detailed logging.

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Activelast commit Jul 2, 2026
License
Apache 2.0

Pinned Snippet

workflow.ymlSHA-pinned
uses: bcgov/action-oc-runner@111868d1fc50db0a40417ba321d865ef5c931bbd # v1.7.0

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
oc_namespaceOpenShift namespace Example: abc123-dev, abc123-test, abc123-prod yes
oc_serverOpenShift server URL with port Example: https://api.silver.devops.gov.bc.ca:6443 yes
oc_tokenOpenShift access token for authentication Should be stored as a GitHub secret yes
commandsCommands to run (generally oc commands) Example: oc whoami
cronjobName of the cronjob to execute and monitor Example: nr-repository-name-cronjob-component
triggersBash array to diff for triggering, omit to always run Example: ('./common', './backend/' './frontend/)
cronjob_tailNumber of cronjob log lines to tail; use -1 for all Example: 100, 200, -1 -1
diff_branchBranch to diff against Example: main, master, SHA or tag ${{ github.event.repository.default_branch }}
oc_versionOverride oc version, >= 4.0 Example: 4.18 4.18
repositoryOptionally, specify a different repo to clone Example: bcgov/openshift-quickstart ""
refThe branch, tag or SHA to checkout; omit to use the current branch Example: main, master, SHA or tag ""
timeoutTimeout for commands or cronjob Example: 10m, 30s, 1h 10m
github_tokenSpecify token (GH or PAT), instead of inheriting one from the calling workflow${{ github.token }}
verboseEnable bash xtrace (`set -x`) for commands input debugging Example: true, false false
login_attemptsMaximum number of connection retry attempts for logging into OpenShift Example: 5, 10 5
namedescription
commandsGeneric output channel for data produced by the commands step. Typically populated via $GITHUB_OUTPUT in the commands step and may be empty if no commands are run or the commands step does not execute.
job-nameName of the job created from the cronjob param
triggeredWhether the action was triggered