Has anyone played with getting good outputs from g...
# general
w
Has anyone played with getting good outputs from github actions?
1
b
what do you mean?
w
As in the output of 'up'... currently it includes all the installing, building etc. I'd prefer to hide that, and just output the outcome
c
Also action related: Is the output from the Pulumi GitHub Action provided in some structured way, so one can deploy onto the resource within an action right after?
The docs does not say.
w
I thought there was a json output you could use..
b
so the pulumi github action already includes a way to get the outputs directly: https://github.com/pulumi/actions#stack-outputs
so if you have an output called "pet-name" then in the action you can do:
Copy code
- uses: pulumi/actions@v2
  id: pulumi
  env:
    PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }}
  with:
    command: up
    cloud-url: <gs://my-bucket>
    stack-name: dev
- run: echo "My pet name is ${{ steps.pulumi.outputs.pet-name }}"
@chilly-analyst-14900 / @worried-knife-31967 does that help? We can make changes in this area - this is something that @elegant-window-55250 and I care about making right
e
Please let us know if we can improve here. 👍
c
ah, yes! thanks! I was looking here (pulumi.com) for it, so maybe a link to the repo where the doc is would be useful for discoverability. https://www.pulumi.com/docs/guides/continuous-delivery/github-actions/
b
ok - I will definitely get that added to the guide! good feedback there - sorry I missed that the first time around
w
I'm more talking about a view of the "outcome" rather than the outputs. So the things like what was changed, etc. in a nicer way. I've seen this happen with CLI's that are based on curses type outputs.
you end up with the output being like this:
Copy code
Downloading plugin: 0 B / 56.35 MiB    0.00%
  [resource plugin azure-native-0.7.1] installing
  
  
  Downloading plugin: 0 B / 22.71 MiB    0.00%
  
  Downloading plugin: 3.75 MiB / 22.71 MiB   16.49% 1s
  
  Downloading plugin: 4.17 MiB / 56.35 MiB    7.41% 2s
  
  Downloading plugin: 8.81 MiB / 22.71 MiB   38.79%
  
  Downloading plugin: 9.11 MiB / 56.35 MiB   16.16% 2s
  
  Downloading plugin: 12.37 MiB / 22.71 MiB   54.48%
  
  Downloading plugin: 12.67 MiB / 56.35 MiB   22.49% 2s
  
  Downloading plugin: 17.19 MiB / 22.71 MiB   75.72%
  
  Downloading plugin: 17.27 MiB / 56.35 MiB   30.65% 1s
  
  Downloading plugin: 20.62 MiB / 22.71 MiB   90.81%
  
  Downloading plugin: 22.13 MiB / 56.35 MiB   39.28% 1s
  
  Downloading plugin: 22.71 MiB / 22.71 MiB  100.00% 1s
  
  
  
  Downloading plugin: 27.08 MiB / 56.35 MiB   48.07% 1s
  
  Downloading plugin: 34.94 MiB / 56.35 MiB   62.01%
  
  Downloading plugin: 44.35 MiB / 56.35 MiB   78.70%
  
  Downloading plugin: 52.31 MiB / 56.35 MiB   92.83%
  
  Downloading plugin: 56.35 MiB / 56.35 MiB  100.00% 1s
and this:
Copy code
pulumi:pulumi:Stack [REDACTED].Infra-exampleshared.dev running 'dotnet build -nologo .' completed successfully
  
      azure-native:resources:ResourceGroup cp-shared-ukwest-main  
  
      azure-native:resources:ResourceGroup cp-shared-main  
  
      azure-native:resources:ResourceGroup cp-shared-uksouth-main  
  
      azure-native:apimanagement:ApiManagementService cp-shared-uksouth  
  
      azure-native:apimanagement:ApiManagementService cp-shared-ukwest  
  
   ~  azure:frontdoor:Frontdoor cp-shared-dev updating [diff: ~backendPoolHealthProbes]
  
   ~  azure:frontdoor:Frontdoor cp-shared-dev updated [diff: ~backendPoolHealthProbes]
  
      pulumi:pulumi:Stack [REDACTED].Infra-exampleshared.dev
b
there is a lot of work ongoing now for the automation api to remove that output and make it more useful
remember, automation api is not yet GA
GHA is using the automation api under the hood 😉
just a little longer wait here
w
BUT I WANT IT NOW GODDAMN IT
😎 1
b
😄
The nice thing here is, as things change, you will get it for free 🙂
e
😄
w
free is always the best price 😄