Skip to content

new_comment_digest #177

new_comment_digest

new_comment_digest #177

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 }}