A 🤖 for drafting and publishing new GitHub discussions using pull requests.
Do you use GitHub discussions? Do you create announcements for your open-source projects or team posts? How do you get feedback or peer reviews on your post before creating it?
Now you can:
1️⃣ Create a pull request to get feedback from your teammates on your announcement
2️⃣ Merge the pull request to have your announcement posted!
You can even use private repos to draft announcements and get feedback privately, and on merge have the announcement created in your public repo.
No more copy/pasting your post content into Google Docs. No more rewriting the markdown. Write the markdown once, get feedback and merge 🚀 This works on repository discussions, organization discussions, and legacy team posts.
-
Install the GitHub App and authorize it for any repositories or orgs you would like it to watch or post to.
-
Add a
.github/announcement-drafter.yml
(not.yaml
) configuration file to any repositories you want the bot to watch.- Provide what folders you want the
announcement-drafter
bot to watch and (optionally) what folders you would like it to ignore when new pull requests are open.
watch_folders: - docs/discussions/
- Provide what folders you want the
-
Create a markdown (
*.md
) file with some metadata at the top - see Draft an Org or Repository Discussion or Draft a team post -
Write your discussion in the body of the markdown file
-
Create a pull request
-
announcement-drafter
will pick it up -
When the pull request is merged, it will create the discussion for you
A note on org discussions: Org discussions are backed by repository discussions, so just point to the repository used by your org discussions and 🪄 it will work!
<!--
repo: https://github.com/philip-gai/announcement-drafter-demo
category: announcements
-->
<!-- This is the discussion title -->
# Hello World! 👋
<!-- This is the discussion body -->
Hello beautiful world! 🌎
<!--
team: https://github.com/orgs/elastico-group/teams/everyone
-->
<!-- This is the post title -->
# Hello World! 👋
<!-- This is the post body -->
Hello beautiful world! 🌎
Demo repo: announcement-drafter demo
Name | Description | Required | Example |
---|---|---|---|
repository or repo |
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 | Conditional: Required if repository is provided |
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 |
These 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 |
ignore_folders |
A list of what folders (relative paths) announcement-drafter should ignore when new pull requests are open |
No | See demo config |
Example announcement-drafter.yml:
watch_folders:
- docs/discussions/
ignore_folders:
- docs/discussions/ignore/
I opened a pull request, but I never received a comment on the pull request from Announcement Drafter. What did I do wrong?
Make sure that you:
- Installed the app on the repository you created the pull request from
- Added a
.github/announcement-drafter.yml
file to the repository withwatch_folders
- Created a new
*.md
file inside one of thewatch_folders
from a branch- Announcement Drafter will only process files that were added. It will not process files that were removed, modified, renamed, copied, changed or unchanged.
- Opened a pull request targeting the repository's default branch (i.e.
main
)- Announcement Drafter will ignore draft pull requests
Also, try closing and re-opening your PR after making any changes to the announcement drafter configuration to trigger the flow again.
If you followed all of the above steps and are still experiencing issues, please open an issue 🙂
If you have suggestions for how announcement-drafter could be improved, or want to report a bug, open an issue! We'd love all and any contributions.
For more, check out the Contributing Guide.