Not sure which channel is right for this. I am us...
# general
i
Not sure which channel is right for this. I am using GitHub action to do a configuration drift check on a cron schedule. I am attempting to create an issue in GitHub when drift is detected. The step looks like this:
Copy code
- uses: pulumi/actions@v4
        id: pulumi
        env:
          PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
        with:
          stack-name: ${{ env.stack }}
          command: preview
          refresh: true
          expect-no-changes: true
          diff: true
When I attempt to access the stack output as below, it comes back blank:
Copy code
${{ steps.pulumi.outputs.output }}
Any suggestions on the correct way to access the output? I essentially want the same output that would be there if
comment-on-pr
were set to
true
. Since my action is running on cron rather than pr, I’m unable to use that command. Many thanks! 🙏
also tried
steps.pulumi.outputs.diff
but no luck
Ideally if there is a way to access the diff generated by preview, that’d be best
l
@icy-doctor-13719 - I'm curious if you've taken a look at #pulumi-deployments https://www.pulumi.com/blog/pulumi-deployments/
We offer a REST API for triggering deployments (as well as github push to deploy integration) that makes it easy to build things like drift detection: https://github.com/pulumi/deploy-demos/tree/main/pulumi-programs/drift-detection
i
Hey Evan! 👋 I’ve looked briefly, but will take a closer look soon. Do you happen to know anyone on the Pulumi GitHub actions team that may know this specific answer?
l
I assume you've taken a look at the section in the README: https://github.com/pulumi/actions#stack-outputs I believe the action should have an output with the full output of the preview command: https://github.com/pulumi/actions/blob/master/src/main.ts#L85 The comment content is not directly available as an action output.
As for why you are seeing that
output
field come back blank, I'm not sure. You could try joining all of the output from the step and dumping it to debug.
I wouldn't hesitate to open an issue in github.com/pulumi/actions/issues/new as well!
i
yea - I looked into this as well. I think it’s a bug 😄 opened last night! Deployments looks pretty cool … definitely will be looking into this for some other things as well - appreciate the call-out there!