-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathopened-pr-notification-on-slack.yml
More file actions
42 lines (35 loc) · 1.17 KB
/
opened-pr-notification-on-slack.yml
File metadata and controls
42 lines (35 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: PR Slack Notification
permissions:
contents: read
pull-requests: read
on:
pull_request:
types: [opened, reopened, ready_for_review]
jobs:
notify-slack:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history to access commit messages
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.13'
- name: Install dependencies
run: |
pip install httpx
- name: Send Slack notification
env:
SLACK_TOKEN: ${{ secrets.RUPY_PR_ANNOUNCEMENT_TOKEN }}
SLACK_SERVICE: ${{ secrets.RUPY_PR_ANNOUNCEMENT_CHANNEL_ID }}
SLACK_TEAM: ${{ secrets.RUPY_TOWN_CRIER_SERVICE_ID }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.number }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_URL: ${{ github.event.pull_request.html_url }}
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
REPO_NAME: ${{ github.repository }}
run: python .github/scripts/announce_pr_on_slack.py