{"id":19541596,"url":"https://github.com/brigadecore/brigade-github-gateway","last_synced_at":"2025-04-26T17:30:50.997Z","repository":{"id":37787380,"uuid":"379398540","full_name":"brigadecore/brigade-github-gateway","owner":"brigadecore","description":"A Brigade 2 compatible gateway for events originating from GitHub repos","archived":false,"fork":false,"pushed_at":"2023-02-25T02:28:29.000Z","size":347,"stargazers_count":4,"open_issues_count":5,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-04T16:27:47.028Z","etag":null,"topics":["brigade","brigade-gateway","v2"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brigadecore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-22T20:55:57.000Z","updated_at":"2024-02-09T19:19:47.000Z","dependencies_parsed_at":"2024-06-19T05:39:01.891Z","dependency_job_id":null,"html_url":"https://github.com/brigadecore/brigade-github-gateway","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brigadecore%2Fbrigade-github-gateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brigadecore%2Fbrigade-github-gateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brigadecore%2Fbrigade-github-gateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brigadecore%2Fbrigade-github-gateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brigadecore","download_url":"https://codeload.github.com/brigadecore/brigade-github-gateway/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251025587,"owners_count":21524829,"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":["brigade","brigade-gateway","v2"],"created_at":"2024-11-11T03:11:12.683Z","updated_at":"2025-04-26T17:30:50.643Z","avatar_url":"https://github.com/brigadecore.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Brigade Github Gateway\n\n![build](https://badgr.brigade2.io/v1/github/checks/brigadecore/brigade-github-gateway/badge.svg?appID=99005)\n[![codecov](https://codecov.io/gh/brigadecore/brigade-github-gateway/branch/main/graph/badge.svg?token=ZPY3OF13FC)](https://codecov.io/gh/brigadecore/brigade-github-gateway)\n[![Go Report Card](https://goreportcard.com/badge/github.com/brigadecore/brigade-github-gateway)](https://goreportcard.com/report/github.com/brigadecore/brigade-github-gateway)\n[![slack](https://img.shields.io/badge/slack-brigade-brightgreen.svg?logo=slack)](https://kubernetes.slack.com/messages/C87MF1RFD)\n\n\u003cimg width=\"100\" align=\"left\" src=\"logo.png\"\u003e\n\nBrigade Github Gateway receives webhooks from one or more\n[GitHub Apps](https://docs.github.com/en/developers/apps/about-apps),\ntransforms them to Brigade\n[events](https://docs.brigade.sh/topics/project-developers/events/),\nand emits them into Brigade's event bus.\n\n\u003cbr clear=\"left\"/\u003e\n\nAfter [installation](docs/INSTALLATION.md), subscribe any number of Brigade\n[projects](https://docs.brigade.sh/topics/project-developers/projects/)\nto events emitted by this gateway -- all of which have a value of\n`brigade.sh/github` in their `source` field.\n\nIn the example project definition below, we subscribe to all `watch:started`\nevents emitted by this gateway, provided they've originated from the\n`example-org/example-repo` repository (see the `repo` \n[qualifier](https://docs.brigade.sh/topics/project-developers/events/#qualifiers)).\nYou should adjust this value to match a repository into which you have installed\nyour new GitHub App (see [installation instructions](docs/INSTALLATION.md)).\n\n\u003e ⚠️\u0026nbsp;\u0026nbsp;Counterintuitively, the `watch:started` event occurs when\n\u003e someone _stars_ a repository; not when they start watching it. This is a\n\u003e peculiarity of GitHub and not a peculiarity of this gateway. To learn more\n\u003e about the webhooks handled by this gateway and their corresponding events,\n\u003e check out the [event reference](docs/EVENT_REFERENCE.md).\n\n```yaml\napiVersion: brigade.sh/v2\nkind: Project\nmetadata:\n  id: github-demo\ndescription: A project that demonstrates integration with GitHub\nspec:\n  eventSubscriptions:\n  - source: brigade.sh/github\n    types:\n    - watch:started\n    qualifiers:\n      repo: example-org/example-repo\n  workerTemplate:\n    defaultConfigFiles:\n      brigade.js: |-\n        const { events } = require(\"@brigadecore/brigadier\");\n\n        events.on(\"brigade.sh/github\", \"watch:started\", () =\u003e {\n          console.log(\"Someone starred the example-org/example-repo repository!\");\n        });\n\n        events.process();\n```\n\nAssuming this file were named `project.yaml`, you can create the project like\nso:\n\n```shell\n$ brig project create --file project.yaml\n```\n\nAdding a star to the repo should now send a webhook from GitHub to your gateway.\nThe gateway, in turn, will emit an event into Brigade's event bus. Brigade\nshould initialize a worker (containerized event handler) for every project that\nhas subscribed to the event, and the worker should execute the `brigade.js`\nscript that was embedded in the project definition.\n\nList the events for the `github-demo` project to confirm this:\n\n```shell\n$ brig event list --project github-demo\n```\n\nFull coverage of `brig` commands is beyond the scope of this documentation, but\nat this point,\n[additional `brig` commands](https://docs.brigade.sh/topics/project-developers/brig/)\ncan be applied to monitor the event's status and view logs produced in the\ncourse of handling the event.\n\n## Further Reading\n\n* [Installation](docs/INSTALLATION.md): Check this out if you're an operator who\n  wants to integrate GitHub with your Brigade installation.\n* [Implementing CI/CD](docs/CI_CD.md): Check this out if you're a script author\n  interested in this gateway's most common use case: Enabling you to define\n  and execute CI/CD pipelines in Brigade.\n* [Event Reference](docs/EVENT_REFERENCE.md): Check this out if you're a script\n  author or contributor who requires detailed information about all the webhooks\n  handled by this gateway and the corresponding events the gateway emits into\n  Brigade.\n\n## Contributing\n\nThe Brigade project accepts contributions via GitHub pull requests. The\n[Contributing](CONTRIBUTING.md) document outlines the process to help get your\ncontribution accepted.\n\n## Support \u0026 Feedback\n\nWe have a Slack channel! Visit [slack.brigade.sh](https://slack.brigade.sh) to\njoin us. We welcome any support questions or feedback.\n\nTo report an issue or to request a feature, open an issue\n[here](https://github.com/brigadecore/brigade-github-gateway/issues).\n\n## Code of Conduct\n\nParticipation in the Brigade project is governed by the\n[CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrigadecore%2Fbrigade-github-gateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrigadecore%2Fbrigade-github-gateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrigadecore%2Fbrigade-github-gateway/lists"}