A 🤖 for drafting new GitHub announcements using pull requests
1️⃣ Create a pull request to get feedback from your teammates on your discussion post
2️⃣ Merge the pull request and the discussion automatically gets created in whatever repository or team you want!
Install the GitHub App and authorize for any repositories or teams you would like it to be able to post to or watch for markdown posts.
Add a .github/announcement-drafter.yml (not .yaml) configuration file to any repositories you want the bot to watch. [Look here for an example in the demo repo][announcement-drafter demo config]
announcement-drafter bot to watch and (optionally) what folders you would like it to ignore when new pull requests are openwatch_folders:
- docs/
ignore_folders:
- docs/demo/ignoreNow whenever you create a pull request with discussion markdown in those watch folders, announcement-drafter will ask for approvals to create discussions, and when the pull request is merged, it will create the discussions and post as the author!
See Usage for more specific usage instructions
.github/announcement-drafter.yml file in your repository, announcement-drafter will not do anythinghttps://user-images.githubusercontent.comThese options should go in your repository's .github/announcement-drafter.yml file.
| Name | Description | Required | Example |
|---|---|---|---|
watch_folders | A list of what folders (relative paths) announcement-drafter should watch when new pull requests are open1. It is recommened to include the final / in the path2. announcement-drafter will also watch all subfolders unless you ignore them in ignore_folders | Yes | [See demo config][announcement-drafter demo config] |
ignore_folders | A list of what folders (relative paths) announcement-drafter should ignore when new pull requests are open | No | [See demo config][announcement-drafter demo config] |
announcement-drafter needs to know certain information such as what repository or team to create the discussion in, and what the discussion category should be. This information should be provided in YAML metadata at the top of your markdown file.
Example from demo repository:
<!--
author: philip-gai
repository: https://github.com/philip-gai/announcement-drafter-demo
category: announcements
-->
# Hello World! 👋
Hello beautiful world! 🌎| Name | Description | Required | Example |
|---|---|---|---|
author | The author of the post. Should be your GitHub login (handle) | Yes | philip-gai |
repository | The full url to the repository to create the discussion in Prerequisites: 1. Discussions are enabled 2. The app is installed on the repo | Conditional: Required if no team is provided | https://github.com/philip-gai/announcement-drafter-demo |
team | The full url to the team to create the discussion in Prerequisites: 1. The app is installed on the team organization | Conditional: Required if no repository is provided | https://github.com/orgs/elastico-group/teams/everyone |
category | The name of the discussion category | Yes | announcements |
| Discussion Title | The title of your discussion should be the first top-level header (i.e. # Discussion Title) | Yes | See Example |
| Discussion Body | The body of your discussion is everything after the top-level header | Yes | See Example |
announcement-drafter discussion markdownannouncement-drafter will comment on the discussion markdown file asking for approval from the author to post the discussions. It will also notify you of any validation erros.announcement-drafter can revalidate (Will fix this - see issue #36)announcement-drafter bot asks, make sure to authenticate so it can post as the author and not as itselfannouncement-drafter will create the discussion and reply to the comment with a link to the newly creating discussion