Skip to content

Commit

Permalink
run action
Browse files Browse the repository at this point in the history
  • Loading branch information
Chadiii committed Feb 22, 2024
1 parent eaf6e5a commit fd28e54
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ jobs:

- name: Get the output time
continue-on-error: true
run: echo "hello ${{ toJson(steps.hello.outputs.result)}}"
run: echo "hello ${{ toJson(steps.hello.outputs.COMMAND_RESPONSE)}}"

- name: Set Variable Output
continue-on-error: true
id: newVar
run:
echo "::set-output name=variable_value::${{
toJson(steps.hello.outputs.result) }}"
toJson(steps.hello.outputs.COMMAND_RESPONSE) }}"

- name: Display Variable Value
run: echo "The variable is ${{ steps.newVar.outputs.variable_value }}"
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ inputs:

# Define your outputs here.
outputs:
result:
COMMAND_RESPONSE:
description: 'result of the cli'

runs:
Expand Down
8 changes: 4 additions & 4 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/cliCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class Cli {
if (output.stderr) {
return ''
}
return output.stdout
return JSON.stringify(output.stdout)
} catch (err: any) {
return err.toString()
}
Expand Down
6 changes: 3 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ export async function run(): Promise<void> {
core.getInput('flags')
) */

const result = await cli.Resource(
const commandResponse = await cli.Resource(
'configuration',
'create',
'-n,config-name,-i,ciAction,-s,csAction,-a,aAction,-e,eAction'
)
console.log(result)
core.setOutput('result', result)
console.log(commandResponse)
core.setOutput('COMMAND_RESPONSE', commandResponse)
} catch (err) {}
}

0 comments on commit fd28e54

Please sign in to comment.