-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
72 lines (71 loc) · 2.24 KB
/
action.yml
File metadata and controls
72 lines (71 loc) · 2.24 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: "Slack PR Notifier"
description: "Send or update Slack notifications for PR events"
inputs:
pr_number:
description: "Pull request number"
required: true
pr_title:
description: "Pull request title"
required: true
pr_url:
description: "Pull request URL"
required: true
pr_author:
description: "Pull request author"
required: true
pr_author_type:
description: "Pull request author type (User or Bot)"
required: false
default: "User"
pr_author_avatar:
description: "Pull request author avatar URL"
required: true
slack_bot_token:
description: "Slack bot token"
required: true
slack_channel_id:
description: "Slack channel ID"
required: true
update_message:
description: "Whether to update the message format"
required: false
default: "false"
is_abandoned:
description: "Whether the PR was abandoned (closed without merging)"
required: false
default: "false"
wait_time:
description: "Time to wait for label propagation in milliseconds"
required: false
default: "500"
reaction_delay_ms:
description:
"Optional delay between Slack reaction operations in milliseconds"
required: false
default: "50"
verification_delay_ms:
description: "Optional delay before verifying Slack state in milliseconds"
required: false
default: "300"
runs:
using: "composite"
steps:
- name: Get PR labels and send Slack notification
uses: actions/github-script@v8
env:
SLACK_BOT_TOKEN: ${{ inputs.slack_bot_token }}
SLACK_CHANNEL_ID: ${{ inputs.slack_channel_id }}
PR_NUMBER: ${{ inputs.pr_number }}
PR_TITLE: ${{ inputs.pr_title }}
PR_URL: ${{ inputs.pr_url }}
PR_AUTHOR: ${{ inputs.pr_author }}
PR_AUTHOR_TYPE: ${{ inputs.pr_author_type }}
PR_AUTHOR_AVATAR: ${{ inputs.pr_author_avatar }}
IS_ABANDONED: ${{ inputs.is_abandoned }}
WAIT_TIME: ${{ inputs.wait_time }}
REACTION_DELAY_MS: ${{ inputs.reaction_delay_ms }}
VERIFICATION_DELAY_MS: ${{ inputs.verification_delay_ms }}
with:
script: |
const script = require('${{ github.action_path }}/slack-notifier.js');
await script({ github, context, core });