Hi all :wave: What should i do to support github ...
# getting-started
s
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
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
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
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
@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
Awesome! Glad to hear. 🙌