Reputation: 143
Is there a way to create a step output from inside a code snippet that is executed by a GitHub Action step? My step is running a CDK deploy (TypeScript) command and I'd like to create some GHA outputs from the TypeScript code.
I tried using the code snippet below in TypeScript, but this did not create the outputs I expected:
const accessKey = new CfnAccessKey(this, 'testserKey', {
userName: testUser.userName,
});
core.setOutput('devSecret', accessKey.attrSecretAccessKey);
This is how I'd like to use it in GH Actions:
# step that should create the output
- name: Run CDK deploy
id: run-cdk
run: cdk deploy --all --require-approval=never
# step that should use it
- name: Use variable value
run: echo ${{ steps.run-cdk.outputs.devSecret }}
Is there a way to achieve this?
Upvotes: 0
Views: 1039