Skip to content

Brigade job for commenting on a GitHub pull request

License

Notifications You must be signed in to change notification settings

anjakammer/brigade-pr-comment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maintenance

Comments on a pull request or issue

GitHub App Permissions:

  • read&write Pull Requests

or

  • read&write issues

Required Environment Variables

Key Description
APP_NAME Developer or App Name
WAIT_MS Wait until sending the comment (default: 120000)
COMMENT Comment to send
COMMENTS_URL https: //api.github.com/repos/[org]/[repo]/pulls/[id]
TOKEN jwt token to do api calls

Usage

With the Brigade-GitHub-App:

const payload = JSON.parse(e.payload)
const previewUrl = `${secrets.hostName}/preview/${imageTag}`

const prCommenter = new Job('pr-comment', 'anjakammer/brigade-pr-comment')
prCommenter.env = {
  APP_NAME: 'your-GitHub-App',
  WAIT_MS: '0', // default is 2 minutes
  COMMENT: `Preview Environment is set up: [https://${previewUrl}](${previewUrl})`,
  COMMENTS_URL: payload.body.pull_request.comments_url, // depends on webhook payload
  TOKEN: payload.token
}
prCommenter.run()

TODO

  • automagically fetch comments_url from every webhook payload possible.

This way, only passing the brigade-payload string is needed. comments_url and token can be fetched from it.

About

Brigade job for commenting on a GitHub pull request

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •