https://pulumi.com logo
Title
s

stale-iron-26898

02/01/2022, 4:13 PM
Hi all 👋 What should i do to support github app to print pulumi changes in PR from a running job in jenkins? (the job select stack and run
pulumi preview
)
m

miniature-musician-31262

02/02/2022, 1:38 AM
Hi there. So the job runs in Jenkins, and you want to report its
pulumi preview
results back to the GitHub PR that ran it? There’s a doc here that goes into this: https://www.pulumi.com/docs/guides/continuous-delivery/github-app/ Have you tried running through it? Seeing errors?
I see from your other message that you’re not seeing comments, so I’m assuming you’ve read the doc. Is that right?
The GitHub app works by using the Git SHA (where Pulumi runs, so in this case, in your Jenkins job) to find an associated GitHub PR to post back to, and if it can’t find one, it just no-ops. So the first thing I’d suggest is to make sure the commit SHA Pulumi would see on Jenkins matches one of the commits in your PR.
s

stale-iron-26898

02/02/2022, 3:54 PM
Hi @miniature-musician-31262, Thanks for your response. where the pulumi need to find the sha ? inside the environment variable? and if so what variable name should be?It’s not clear in the doc
m

miniature-musician-31262

02/02/2022, 5:13 PM
Pulumi looks for a
.git
directory relative to the location where it’s run. So for example, if your GitHub project had an
infra
directory containing your Pulumi program, and you ran
pulumi preview
from within that directory, it’d walk up until it found the first
.git
directory and inspect that to get the commit info.
This could definitely be better documented I agree. I’ll make sure we get an issue filed for it and for documenting how to debug this when it doesn’t work as expected.
Filed this: https://github.com/pulumi/pulumi-hugo/issues/1025 Hope this explanation helps — let me know!
s

stale-iron-26898

02/07/2022, 11:24 AM
@miniature-musician-31262 Thanks for the explanation! I still haven’t succeeded to issue PR comment but have some things to checks on my side as we work with IP whitelisting enabled on our Github org (need provide the IP range of the Pulumi backend). in case I’ll encounter in something else I’ll post here in the thread
👍 1
I forgot to update, so if anyone will encounter this, the GitHub action worked successfully with Jenkins PR ! need to make sure the .git exist and pulumi app is installed with the right permission in GitHub org. Thanks @miniature-musician-31262
m

miniature-musician-31262

03/08/2022, 6:12 PM
Awesome! Glad to hear. 🙌