-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pulumi/actions Github action should support mapping stack output to step outputs #43
Comments
Meanwhile I published this action to marketplace, if anyone needs |
@amichel We'd be happy to take a look at a PR if you want to submit one |
What branch should I target in PR? My initial commit was right on master. |
That's fine if it's on master in your fork |
Add support for stack output to Github Action step output. This works as standalone step (e.g. if stack output is passed in args) as well as after stack up, so no additional step is required in such case. Currently only "all" value is supported in step input, which causes all stack outputs to be mapped to step output. Usage: ``` - name: Pulumi Stack id: pulumi uses: docker://pulumi/actions with: args: up MAP_OUTPUT: all env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} PULUMI_CI: up PULUMI_ROOT: my-website-infra - name: Show Output run: | echo ${{steps.pulumi.outputs.targetBucket}} echo ${{steps.pulumi.outputs.targetBucketArn}} - name: S3 Sync id: s3 uses: awact/s3-action@0.1.1 with: args: --follow-symlinks --delete env: AWS_S3_BUCKET: ${{ steps.pulumi.outputs.targetBucket }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_REGION: "eu-west-1" SOURCE_DIR: "./my-website-pages" ```
Please see https://www.azurefromthetrenches.com/integrating-pulumi-stack-output-with-github-actions/ for an end user's experience here. We should definitely make this easier, but in the meantime, hopefully this post helps others. |
I am closing this out as we have just released v2 of our Action which is based on TypeScript and addresses this issue |
In a workflow that has steps not managed by Pulumi, it is required sometimes to use variables from pulumi stack output. A clean way would be to have them available via the outputs of the "stack output" step.
E.g. a simple use case is when I provision buckets in S3 and need they names later on to upload artifacts or test results to S3
Currently I managed to do this in custom action that derives from pulumi/actions image using:
calling it in a step and later in next steps using
${{ steps.pulumiOutput.outputs.myBucketName}}
I believe it should be easy to enable this in pulumi/actions , maybe even do it by default/with flag after pulumi up command, so no additional step will be required
The text was updated successfully, but these errors were encountered: