Closed xiaotianq closed 4 years ago
Thanks for reporting this error and including your configuration.
The session string is used as a key to sign sessions when users visit the details UI. It can be any random string. On macOS or Linux, you can generate an appropriate value using something like:
head -c32 /dev/urandom | xxd -p -c 64
There are two different IDs here. The integration ID is the ID of your app in GitHub. For each organization where your app is installed, an installation ID is also created, representing the "installation of this app on this organization". This should be included as part of the webhook payload automatically, so the fact that it is 0
leads me to believe it was not included. Did you install the app on this organization/repository or did you manually create a webhook?
Hi, bluekeyes, thanks for your answer. For question 2, I installed the Gitapp on my own account with own repo for testing. and I created a webhook manually inside the repo. Here is the payload sending to my pod/container for pull request.
Can you try deleting the manually created webhook? When you install the GitHub App, it automatically adds a webhook behind the scenes that does not appear in the normal webhook list on each repository. Instead, you can view all webhook deliveries associated with the application from the "Advanced" tab of the application settings.
Thanks, I just reinstalled the policy-bot to my repo:
here is the paste for GitApp's own webhook payload:
https://gist.github.com/xiaotianq/8ec73041b2f2aa38f283fcfaed1dc425
See there are several ids, which one should I paste into field integration_id
of policy-bot config?
And the response on the installation action of webhook is:
Invalid webhook headers or payload
The app_id
value (56314) should be set as the integration_id
in the policy-bot config.
If everything is working, payloads for this repository will contain 7185762 as the installation ID.
The most common cause for the Invalid webhook headers or payload
is if the value set for webhook_secret
in the configuration does not match the value that was set in the GitHub UI when you created the application.
Thanks for all the help, bluekeyes
Above is my container logs
And inside the log there is an error says
Get https://api.github.com/repos/xiaotianq/go-micro-test/contents/.policy.yml?ref=master: could not refresh installation id 0's token: received non 2xx response status
I set up the configs yml file like:
https://gist.github.com/xiaotianq/f5014ddd6960bd153d1d2d7dfea13ee7
iInside the config, I defined integration id:
integration_id: 56314
I commented out
sessions: A random string used to sign session cookies key: ?????
Q1. Where is this session number coming from? Q2. Why did I set the integration_id: 56314 to my app id, but the error said
0
?