Monitor Inactive Open Issues #81
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Monitor Inactive Open Issues | |
#Runs every Monday and Thursday at 9:00 A.M | |
on: | |
schedule: | |
- cron: "0 9 * * 1,4" | |
env: | |
inactiveIntervalDays: ${{ vars.MONITORING_INACTIVE_INTERVAL_DAYS }} | |
jobs: | |
retrieve-inactive-issues: | |
runs-on: ubuntu-latest | |
permissions: | |
issues: write | |
outputs: | |
issues: ${{ steps.filter-inactive-issues.outputs.result }} | |
steps: | |
- name: Check environment | |
run: | | |
if [ -z $inactiveIntervalDays ]; then | |
echo "::error::'MONITORING_INACTIVE_INTERVAL_DAYS' environment variable is not set" | |
exit 1 | |
fi | |
- uses: actions/checkout@v3 | |
if: success() | |
- name: Filter inactive issues | |
id: filter-inactive-issues | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const script = require('./.github/workflows/scripts/filterInactiveIssues.js'); | |
return await script({github, context, core}); | |
notify-inactive-issues: | |
runs-on: ubuntu-latest | |
needs: retrieve-inactive-issues | |
if: ${{ needs.retrieve-inactive-issues.outputs.issues }} | |
strategy: | |
matrix: | |
issues: ${{ fromJSON(needs.retrieve-inactive-issues.outputs.issues) }} | |
steps: | |
- name: Notify MS Teams channel | |
id: notify-ms-teams | |
uses: simbo/msteams-message-card-action@latest | |
with: | |
webhook: ${{ secrets.COMMUNITY_EVENTS_WEBHOOK_URL }} | |
title: Inactive Issue Detected | |
message: | | |
It's been <i>${{ env.inactiveIntervalDays }} days</i> since issue number <code>${{ matrix.issues.number }}</code> has received an update. <strong>${{ matrix.issues.assignee }}</strong>, please provide an update soon. | |
buttons: | | |
View Issue on GitHub ${{ matrix.issues.url }} |