Welcome to the GitHub to Teams PR Alerts Action! This GitHub Action is designed to notify your Microsoft Teams channel whenever a Pull Request is reviewed or requested on GitHub, making collaboration smoother and more efficient. ๆฅๆฌ่ช็ใฎREADMEใฏใใกใ
- Review Request Notifications: Sends a notification to Teams when a Pull Request is requested.
- Review Submission Notifications: Alerts your team when a review is submitted, especially if changes are requested.
- Customizable: Easily map your GitHub usernames to Microsoft Teams emails within the workflow for personalized notifications.
Before you set up this action, ensure you have the following:
- A Microsoft Teams channel with a configured incoming webhook.
- The webhook URL added to your GitHub repository secrets.
-
Add the Webhook URL to Your Secrets:
- Go to your repository's settings.
- Navigate to
Secrets
and then toActions
. - Click on
New repository secret
. - Name your secret
TEAMS_WEBHOOK_URL
and paste your Microsoft Teams webhook URL.
-
Define User Mappings:
- In the workflow file, adjust the
USER_EMAIL_MAPPING_JSON
to include mappings from GitHub usernames to Teams emails. - Example format:
"github_username": "email@example.com"
- In the workflow file, adjust the
-
Enable/Disable Notifications:
- Use the
SEND_TO_TEAMS
environment variable to control notification sending (set tofalse
to disable).
- Use the
- Check TEAMS_WEBHOOK_URL: Ensures that the webhook URL is specified.
- Define User Mappings: Maps GitHub usernames to Teams emails.
- Notification Triggers:
- When a review is requested.
- When a review is submitted with changes requested.
- Create a
.github/workflows/
directory in your repository if it doesn't exist. - Add the
github-to-teams-pr-alerts.yml
file to this directory. - Customize the user mappings and webhook URL as described above.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
If you run into issues or have any questions, please feel free to raise an issue in the repository or submit a pull request with improvements!
Happy coding! ๐