How does the <Pulumi GitHub App> communicate with ...
# general
a
How does the Pulumi GitHub App communicate with pulumi? I am using GitHub Actions, however I am running pulumi inside docker containers to have a reproducible build environmen.
q
When you install the application to your repository, GitHub gives it permission to comment on your pull requests. As long as you're using Pulumi SaaS backend for state, it will integrate just fine, even if you're running Pulumi in a container
a
Thanks, then how would I go about debugging it? • I’m using the pulumi saas backend (though it’s an individual account) • I have installed the GitHub app on an GitHub organization • I’m not getting the comment
• I’m running pulumi in a container • It doesn’t have full access to the repository(and
.git
folder), but only get’s the pulumi source
Although the pulumi saas backend has the right metadata about the repository
Does it only work with organisation acounts?
I’d be fine to switch to that if that’s required
q
Hmm. I'm unsure. Let me test this out on one of my own repos and I'll get back to you 🙂
a
Okay, thanks
m
This thread may help — in short, there does need to be a .git folder available: https://pulumi-community.slack.com/archives/C01PF3E1B8V/p1643731985904229
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.
a
Oh okay, that’s unfortunate. Is there a way to just set some environment variables to pass this info?
I don’t want to make the git folder available, as my build system restricts the available source, etc. to enable reproducible builds & caching
m
I don't believe so, but I'll check and report back.
So just to circle back on this, it looks like we do rely on the
.git
directory at runtime to gather the data we need to be able to post back to GitHub. I do agree, though, that it’d be nice to be able to specify this data on the environment as an alternative. Would you be up for filing an issue describing how you’d like this to work? If not, I’m happy to file one for you.
a