git clone <this repository's link>
Navigate to the Slack API page and create a new app. This app will manage the notifications from Gitea to your Slack workspace.
On your app's OAuth & Permissions page, add the following scopes to enable the necessary permissions:
- channels:write.invites: Invite members to public channels
- chat:write: Send messages as @Gitea Notifications
- groups:write: Manage private channels that Gitea Notifications has been added to and create new ones
- im:write: Start direct messages with people
- incoming-webhook: Post messages to specific channels in Slack
- users:read: View people in a workspace
- users:read.email: View email addresses of people in a workspace
Copy your app's Bot User OAuth Token and paste it into the .env file in your project directory.
With the .env file configured, navigate to your project directory and set up the Python environment:
cd <to_local_project>
python -m venv ./.venv
.\.venv\Scripts\activate
pip install -r requirements.txt
python main.py
- In your Gitea project, go to Settings > Webhooks.
- Click on Add Webhook > Gitea.
- For Target URL, enter http://<gitea2slack_ip>:8765/webhook where <gitea2slack_ip> is the IP address or domain of the server running Gitea2Slack.
- Set the HTTP Method to POST.
- Choose application/json as the POST Content Type.
- Under Trigger On, select Custom Events.
- Check the boxes for Pull Request Assigned and Pull Request Reviewed to specify which events should trigger notifications.
Now, your setup is complete! Gitea2Slack will forward notifications for the specified events from your Gitea repository directly to your Slack workspace, keeping your team informed and engaged.