Skip to content

Run a ok command

Run a ok command #6

name: Run a ok command
on:
workflow_dispatch:
inputs:
subcommand:
type: choice
description: 'The ok command to run'
options:
- 'env'
- 'bootstrap'
- 'scaffold'
working_directory:
description: >
The working directory to run ok from.
required: true
type: string
create_pr:
type: boolean
description: 'Create a PR with the changes'
default: false
workflow_call:
secrets:
GPG_PRIVATE_KEY:
description: "The GPG private key to use for signing commits"
required: true
GPG_PASSPHRASE:
description: "The passphrase for the GPG private key"
required: true
inputs:
subcommand:
type: string
description: 'The ok command to run'
required: true
create_pr:
type: boolean
description: 'Create a PR with the changes'
default: false
jobs:
mage:
name: "Run ok subcommand ${{ inputs.subcommand }}"
runs-on: macos-latest
defaults:
run:
shell: bash
steps:
- if: runner.os == 'linux'
name: Add Homebrew to PATH
run: echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install ok
env:
HOMEBREW_GITHUB_API_TOKEN: "${{ github.token }}"
run: |
brew tap oslokommune/ok https://github.com/oslokommune/ok
brew install ok
ok "${{ inputs.subcommand }}"