@quantum-sec/xdr-updater v1.5.2
xdr-updater
Builds and deploys the GitHub app that will update customers XDR IAC code
Pre-installation
Ensure that the customer's XDR IAC repos are all saved in the customer DB.
Installation on customer GitHub repos
- Go to the GitHub App page
- Click "Configure"
- Select the customer's GitHub organization
- Select "Only select repositories" to give the app
permissions on customer's repos
- infrastructure-live
- and infrastructure-modules
- Click "Save"
Development
We can run the Node app locally with npm run start
.
To do that, we can make a copy of .env-sample
, and name it .env
.
This file should not be committed to VCS.
Replace all the environment variables to suit your dev environment.
Then run the below:
npm run start
List of all GitHub events
GitHub documentation for all the events is here: https://github.com/octokit/webhooks.js/blob/c38a34af60812da28aac600acc956150113e404e/README.md#webhook-events and here: https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads
Or we can get them by running this command:
curl -s https://octokit.github.io/webhooks/payload-examples/api.github.com/index.json
or to use JQ to make it a bit more readable:
curl -s https://octokit.github.io/webhooks/payload-examples/api.github.com/index.json \
| jq 'map({name: .name, desc: .description})'
For example, the GitHub event that determines when a customer has installed/uninstalled our GitHub App is:
curl -s https://octokit.github.io/webhooks/payload-examples/api.github.com/index.json \
| jq 'map({name: .name, desc: .description, actions: .actions, properties: .properties})[] | select(.name == "installation")'
The first example is (when our GitHub App is "deleted"):
curl -s https://octokit.github.io/webhooks/payload-examples/api.github.com/index.json \
| jq '.[] | select(.name == "installation") | .examples[0]'