Skip to content

Commit

Permalink
Added more stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
stevencl840 committed Dec 17, 2024
1 parent aabe3d7 commit 52918e0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ steps:
| `server` | The instance URL hosting Octopus Deploy (i.e. "<https://octopus.example.com/>"). The instance URL is required, but you may also use the OCTOPUS_URL environment variable. |
| `api_key` | The API key used to access Octopus Deploy. An API key is required, but you may also use the OCTOPUS_API_KEY environment variable. It is strongly recommended that this value retrieved from a GitHub secret. |
| `space` | The name of a space within which this command will be executed. The space name is required, but you may also use the OCTOPUS_SPACE environment variable. |
| `gitRef` | The Git Reference on which to run the Runbook. If not populate the action assumes you are running a DB Runbook. In most cases when running a Git Runbook this will be your default branch refs/heads/main |
| `git_ref` | The Git Reference on which to run the Runbook. If not populate the action assumes you are running a DB Runbook. In most cases when running a Git Runbook this will be your default branch refs/heads/main |

## 📤 Outputs

Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ inputs:
description: 'The API key used to access Octopus Deploy. An API key is required, but you may also use the OCTOPUS_API_KEY environment variable. It is strongly recommended that this value retrieved from a GitHub secret.'
space:
description: 'The name of a space within which this command will be executed. The space name is required, but you may also use the OCTOPUS_SPACE environment variable.'
gitRef:
git_ref:
description: 'The Git Reference on which to run the Runbook. If not populate the action assumes you are running a DB Runbook. In most cases when running a Git Runbook this will be your default branch refs/heads/main'

outputs:
Expand Down
6 changes: 4 additions & 2 deletions src/api-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export interface RunbookRunResult {
}

export async function runRunbookFromInputs(client: Client, parameters: InputParameters): Promise<RunbookRunResult[]> {
client.info(`🐙 Running runbooks in Octopus Deploy with GitRef ${parameters.gitRef}...`)

if (parameters.gitRef) {
return await runGitRunbookFromInputs(client, parameters)
}
Expand All @@ -25,7 +27,7 @@ export async function runRunbookFromInputs(client: Client, parameters: InputPara
}

async function runGitRunbookFromInputs(client: Client, parameters: InputParameters): Promise<RunbookRunResult[]> {
client.info('🐙 Running runbooks in Octopus Deploy...')
client.info('🐙 Running Git runbooks in Octopus Deploy...')

const command: RunGitRunbookCommand = {
spaceName: parameters.space,
Expand All @@ -50,7 +52,7 @@ async function runGitRunbookFromInputs(client: Client, parameters: InputParamete
}

async function runDbRunbookFromInputs(client: Client, parameters: InputParameters): Promise<RunbookRunResult[]> {
client.info('🐙 Running runbooks in Octopus Deploy...')
client.info('🐙 Running DB runbooks in Octopus Deploy...')

const command: CreateRunbookRunCommandV1 = {
spaceName: parameters.space,
Expand Down
2 changes: 1 addition & 1 deletion src/input-parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function getInputParameters(): InputParameters {
tenantTags: getMultilineInput('tenant_tags').map(p => p.trim()) || undefined,
useGuidedFailure: getBooleanInput('use_guided_failure') || undefined,
variables: variablesMap,
gitRef: getInput('git-ref') || undefined
gitRef: getInput('git_ref') || undefined
}

const errors: string[] = []
Expand Down

0 comments on commit 52918e0

Please sign in to comment.