-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
57 lines (55 loc) · 1.82 KB
/
new_comment_digest.yml
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
name: new_comment_digest
on:
schedule: # 08:30 daily
- cron: '30 8 * * *'
workflow_dispatch:
inputs:
slack_channel:
description: 'Digest is published to this channel. Include leading `#` symbol in channel name. Entering an empty string will skip publishing to Slack.'
type: string
hours:
description: 'Search for issues that have new comments within this number of hours.'
type: number
required: true
default: 24
verbose_mode:
description: 'Display detailed information about the issues that need responses? (Verbose mode)'
type: choice
default: 'No'
options:
- 'Yes'
- 'No'
permissions:
contents: read
issues: write
jobs:
new_comment_digest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: pip install requests
- name: Set environment variable for Slack channel argument
env:
CHANNEL: ${{ inputs.slack_channel }}
run: |
CHANNEL_ARG=''
if [[ -n $CHANNEL ]]; then
CHANNEL_ARG='-s "$CHANNEL"'
fi
echo "CHANNEL_ARG=$CHANNEL_ARG" >> $GITHUB_ENV
- name: Set environment variable for verbose flag
env:
VERBOSE: ${{ inputs.verbose_mode }}
run: |
VERBOSE_FLAG=''
if [[ $VERBOSE == 'Yes' ]]; then
VERBOSE_FLAG='-v'
fi
echo "VERBOSE_FLAG=$VERBOSE_FLAG" >> $GITHUB_ENV
- run: scripts/gh_scripts/issue_comment_bot.py ${{ inputs.hours }} -c .github/workflows/config/new_comment_digest.json ${{ env.CHANNEL_ARG }} ${{ env.VERBOSE_FLAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}