Skip to main content

[Beta] Github Pull Request Integration

caution

This feature is currently in early access. Note that this feature requires the Signadot Github App to be installed, linked with your Signadot Organization and configured with appropriate Github repository permissions. Contact us via our community slack or on github to learn more.

Overview

Github Pull Request Integration can be used to tie a Sandbox to the lifecycle of a Github Pull Request. The Sandbox is automatically deleted when the Pull Request is closed. It is specifed using Sandbox Labels.

Specification

There are 2 special label keys that can be used to specify the association with a Github pull request. These labels are:

Label KeyValueExample
signadot/github-repopath of github repository (org/repo)signadot/community
signadot/github-pull-requestpull request number"123"

Example

In order to make use of this integration, typically you will want to add the above template variables to the sandbox specification stored under .signadot in your repository. An example specification is written as shown below:

name: pr-xyz-@{github-pr}
spec:
cluster: signadot-staging
description: sandbox for @{github-pr}
labels:
signadot/github-repo: "github-org/github-repo"
signadot/github-pull-request: "@{github-pr}"
forks:
- forkOf:
kind: Deployment
namespace: workspaces
name: web
customizations:
images:
- image: "myrepo/image:@{tag}"
defaultRouteGroup:
# ...

If you're using Github actions, the invocation of the sandbox create / update looks like the following:

docker run -i \
-e SIGNADOT_ORG="your-signadot-org" \
-e SIGNADOT_API_KEY=${{ secrets.SIGNADOT_API_KEY }} \
signadot/signadot-cli \
/signadot sandbox apply \
--set tag=${{ github.sha }} \
--set github-pr=${{ github.event.number }} \
-f - \
-o json \
< ${GITHUB_WORKSPACE}/.signadot/sandbox-template.yaml \
> ${GITHUB_WORKSPACE}/.signadot/sandbox-response.json

You may also invoke the same integration through the Signadot API by passing the same label parameters shown above.