Automatically updates Github issues represented in ZenHub with their pipeline as a label.
MIT License
cloudformation-zenhub-github-label
is an AWS SAM + CloudFormation template designed to
automatically update Github issues with their current ZenHub pipeline.
It's simple! Click this fancy button:
Then give the stack a name, and configure it:
Parameter | Required | Default Value | Description |
---|---|---|---|
GithubToken | Yes | Your Github authentication token. Requires the repo scope. |
|
Pipelines | Yes | A comma-separated list of ZenHub pipelines to track in Github. | |
DebugLevel | No | <empty string> |
The DEBUG environment variable for the Lambda. Set to cloudformation-zenhub-github-label to enable debug messages. |
Output | Description |
---|---|
APIEndpoint | The API Gateway endpoint to add to ZenHub |
Add something like this underneath resources:
videoThumbnailStack:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://sammarks-cf-templates.s3.amazonaws.com/zenhub-github-label/VERSION/template.yaml
Parameters:
GithubToken: 'abcde'
Pipelines: 'Done, Todo'
DebugLevel: ''
Note: This stack will require the CAPABILITY_AUTO_EXPAND
capability when deploying
the parent stack with CloudFormation. If you are using the Serverless framework, you can
"trick" it into adding the required capabilities by adding this to your serverless.yaml
:
resources:
Transform: 'AWS::Serverless-2016-10-31' # Trigger Serverless to add CAPABILITY_AUTO_EXPAND
Resources:
otherResource: # ... all of your original resources
A quick note on regions: If you are deploying this stack in a region other than us-east-1
,
you need to reference the proper region S3 bucket as we're deploying Lambda functions. Just
add the region suffix to the template URL, so this:
https://sammarks-cf-templates.s3.amazonaws.com/zenhub-github-label/VERSION/template.yaml
becomes this:
https://sammarks-cf-templates-us-east-2.s3.amazonaws.com/zenhub-github-label/VERSION/template.yaml
The Lambda goes through the following steps:
zh:
)Each time a release is made in this repository, the corresponding template is available at:
https://sammarks-cf-templates.s3.amazonaws.com/zenhub-github-label/VERSION/template.yaml
On upgrading: I actually recommend you lock the template you use to a specific version. Then, if you want to update to a new version, all you have to change in your CloudFormation template is the version and AWS will automatically delete the old stack and re-create the new one for you.
Let's say you're using something like cloudformation-github-sheets-sync and you want to keep track of the ZenHub pipeline inside your spreadsheet so you can do some reporting on it. Before, you would have to make an API request to ZenHub from Google Sheets, which is possible, but you run into problems with API limits.
Since ZenHub also supports webhooks, this Lambda function just updates the labels on Github which have first-party support from the cloudformation-github-sheets-sync script.