{"id":13565709,"url":"https://github.com/sammarks/cloudformation-zenhub-github-label","last_synced_at":"2025-04-22T13:18:57.316Z","repository":{"id":43949005,"uuid":"261551824","full_name":"sammarks/cloudformation-zenhub-github-label","owner":"sammarks","description":"Automatically updates Github issues represented in ZenHub with their pipeline as a label.","archived":false,"fork":false,"pushed_at":"2023-01-05T11:16:00.000Z","size":1837,"stargazers_count":2,"open_issues_count":15,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-22T13:18:44.113Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sammarks.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-05T18:26:46.000Z","updated_at":"2023-03-18T19:44:00.000Z","dependencies_parsed_at":"2023-02-04T02:46:49.777Z","dependency_job_id":null,"html_url":"https://github.com/sammarks/cloudformation-zenhub-github-label","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammarks%2Fcloudformation-zenhub-github-label","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammarks%2Fcloudformation-zenhub-github-label/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammarks%2Fcloudformation-zenhub-github-label/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammarks%2Fcloudformation-zenhub-github-label/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sammarks","download_url":"https://codeload.github.com/sammarks/cloudformation-zenhub-github-label/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250246730,"owners_count":21398919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:01:53.692Z","updated_at":"2025-04-22T13:18:57.271Z","avatar_url":"https://github.com/sammarks.png","language":"JavaScript","readme":"![][header-image]\n\n[![CircleCI](https://img.shields.io/circleci/build/github/sammarks/cloudformation-zenhub-github-label/master)](https://circleci.com/gh/sammarks/cloudformation-zenhub-github-label)\n[![Coveralls](https://img.shields.io/coveralls/sammarks/cloudformation-zenhub-github-label.svg)](https://coveralls.io/github/sammarks/cloudformation-zenhub-github-label)\n[![Dev Dependencies](https://david-dm.org/sammarks/cloudformation-zenhub-github-label/dev-status.svg)](https://david-dm.org/sammarks/cloudformation-zenhub-github-label?type=dev)\n[![Donate](https://img.shields.io/badge/donate-paypal-blue.svg)](https://paypal.me/sammarks15)\n\n`cloudformation-zenhub-github-label` is an AWS SAM + CloudFormation template designed to\nautomatically update Github issues with their current ZenHub pipeline.\n\n## Get Started\n\nIt's simple! Click this fancy button:\n\n[![Launch Stack](https://s3.amazonaws.com/cloudformation-examples/cloudformation-launch-stack.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=zenhub-github-label\u0026templateURL=https://sammarks-cf-templates.s3.amazonaws.com/zenhub-github-label/template.yaml)\n\nThen give the stack a name, and configure it:\n\n### Parameters\n\n| Parameter | Required | Default Value | Description |\n| --- | --- | --- | --- |\n| GithubToken | **Yes** | | Your Github authentication token. Requires the `repo` scope. |\n| Pipelines | **Yes** | | A comma-separated list of ZenHub pipelines to track in Github. |\n| DebugLevel | No | `\u003cempty string\u003e` | The `DEBUG` environment variable for the Lambda. Set to `cloudformation-zenhub-github-label` to enable debug messages. |\n\n### Outputs\n\n| Output | Description |\n| --- | --- |\n| APIEndpoint | The API Gateway endpoint to add to ZenHub |\n\n### Usage in Another Stack or Serverless\n\nAdd something like this underneath resources:\n\n```yaml\nvideoThumbnailStack:\n  Type: AWS::CloudFormation::Stack\n  Properties:\n    TemplateURL: https://sammarks-cf-templates.s3.amazonaws.com/zenhub-github-label/VERSION/template.yaml\n    Parameters:\n      GithubToken: 'abcde'\n      Pipelines: 'Done, Todo'\n      DebugLevel: ''\n```\n\n**Note:** This stack will require the `CAPABILITY_AUTO_EXPAND` capability when deploying\nthe parent stack with CloudFormation. If you are using the Serverless framework, you can\n\"trick\" it into adding the required capabilities by adding this to your `serverless.yaml`:\n\n```yaml\nresources:\n  Transform: 'AWS::Serverless-2016-10-31' # Trigger Serverless to add CAPABILITY_AUTO_EXPAND\n  Resources:\n    otherResource: # ... all of your original resources\n```\n\n### Regions\n\n**A quick note on regions:** If you are deploying this stack in a region other than `us-east-1`,\nyou need to reference the proper region S3 bucket as we're deploying Lambda functions. Just\nadd the region suffix to the template URL, so this:\n\n```\nhttps://sammarks-cf-templates.s3.amazonaws.com/zenhub-github-label/VERSION/template.yaml\n```\n\nbecomes this:\n\n```\nhttps://sammarks-cf-templates-us-east-2.s3.amazonaws.com/zenhub-github-label/VERSION/template.yaml\n```\n\n### What's deployed?\n\n- An API Gateway service\n- A Lambda function for ingesting Webhook notifications from ZenHub.\n\n### How does it work?\n\nThe Lambda goes through the following steps:\n\n- It first checks Github to get information about the labels enabled in the repository and the\n  labels currently present on the issue.\n- It creates the pipeline label if it does not already exist (prefixed with `zh:`)\n- It updates the issue, adding the new pipeline label, removing the old one, and preserving any\n  already-existing labels.\n\n### Accessing Previous Versions \u0026 Upgrading\n\nEach time a release is made in this repository, the corresponding template is available at:\n\n```\nhttps://sammarks-cf-templates.s3.amazonaws.com/zenhub-github-label/VERSION/template.yaml\n```\n\n**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.\n\n## Features\n\n- Automatically update Github issues with their current ZenHub Pipeline for tracking.\n- Automatically creates labels representing the ZenHub pipelines if they do not yet exist.\n- Deploy with other CloudFormation-compatible frameworks (like the Serverless framework).\n- All functionality is self-contained within one CloudFormation template. Delete the template, and all of our created resources are removed.\n\n## Why use this?\n\nLet's say you're using something like [cloudformation-github-sheets-sync](https://github.com/sammarks/cloudformation-github-sheets-sync)\nand you want to keep track of the ZenHub pipeline inside your spreadsheet so you can do some\nreporting on it. Before, you would have to make an API request to ZenHub from Google Sheets, which\n[is possible,](https://sammarks.me/posts/adding-zenhub-estimates-to-google-sheets/) but you run\ninto problems with API limits.\n\nSince ZenHub also supports webhooks, this Lambda function just updates the labels on Github\nwhich have first-party support from the cloudformation-github-sheets-sync script.\n\n[header-image]: https://raw.githubusercontent.com/sammarks/art/master/cloudformation-zenhub-github-label/header.jpg\n","funding_links":["https://paypal.me/sammarks15"],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsammarks%2Fcloudformation-zenhub-github-label","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsammarks%2Fcloudformation-zenhub-github-label","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsammarks%2Fcloudformation-zenhub-github-label/lists"}