{"id":27195021,"url":"https://github.com/anjakammer/brigade-pr-comment","last_synced_at":"2025-04-09T19:44:28.324Z","repository":{"id":41886201,"uuid":"157114204","full_name":"anjakammer/brigade-pr-comment","owner":"anjakammer","description":"Brigade job for commenting on a GitHub pull request","archived":false,"fork":false,"pushed_at":"2023-05-28T10:56:06.000Z","size":132,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-05-28T12:15:35.403Z","etag":null,"topics":["brigade","github-bot"],"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/anjakammer.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2018-11-11T19:39:09.000Z","updated_at":"2023-05-28T12:15:35.404Z","dependencies_parsed_at":"2023-01-25T22:16:29.128Z","dependency_job_id":null,"html_url":"https://github.com/anjakammer/brigade-pr-comment","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anjakammer%2Fbrigade-pr-comment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anjakammer%2Fbrigade-pr-comment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anjakammer%2Fbrigade-pr-comment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anjakammer%2Fbrigade-pr-comment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anjakammer","download_url":"https://codeload.github.com/anjakammer/brigade-pr-comment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248102010,"owners_count":21048086,"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","github-bot"],"created_at":"2025-04-09T19:44:27.750Z","updated_at":"2025-04-09T19:44:28.314Z","avatar_url":"https://github.com/anjakammer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://codeclimate.com/github/anjakammer/brigade-pr-comment/maintainability\"\u003e\u003cimg src=\"https://api.codeclimate.com/v1/badges/f1909b09712611c34fc7/maintainability\" /\u003e\u003c/a\u003e\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/Naereen/StrapDown.js/graphs/commit-activity)\n\n### Comments on a pull request or issue\n\nGitHub App Permissions:\n* read\u0026write Pull Requests\n\nor\n\n* read\u0026write issues\n\n## Required Environment Variables\n\n| Key             | Description                                               |\n| ----------------|-----------------------------------------------------------|\n| `APP_NAME`      | Developer or App Name                                     |\n| `WAIT_MS`       | Wait until sending the comment (default: 120000)          |\n| `COMMENT`       | Comment to send                                           |\n| `COMMENTS_URL`  | https: //api.github.com/repos/[org]/[repo]/pulls/[id]     |\n| `TOKEN`         | jwt token to do api calls                                 |\n\n\n## Usage\nWith the [Brigade-GitHub-App](https://github.com/Azure/brigade-github-app):\n\n```javascript\nconst payload = JSON.parse(e.payload)\nconst previewUrl = `${secrets.hostName}/preview/${imageTag}`\n\nconst prCommenter = new Job('pr-comment', 'anjakammer/brigade-pr-comment')\nprCommenter.env = {\n  APP_NAME: 'your-GitHub-App',\n  WAIT_MS: '0', // default is 2 minutes\n  COMMENT: `Preview Environment is set up: [https://${previewUrl}](${previewUrl})`,\n  COMMENTS_URL: payload.body.pull_request.comments_url, // depends on webhook payload\n  TOKEN: payload.token\n}\nprCommenter.run()\n```\n\n\n## TODO\n- [ ] automagically fetch `comments_url` from every webhook payload possible.\n\nThis way, only passing the brigade-payload string is needed. `comments_url` and `token` can be fetched from it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanjakammer%2Fbrigade-pr-comment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanjakammer%2Fbrigade-pr-comment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanjakammer%2Fbrigade-pr-comment/lists"}