Monitor issues on voting status #8
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 issues on voting status | |
#Runs the first day of each month at 10 A.M | |
on: | |
schedule: | |
- cron: "0 10 1 * *" | |
jobs: | |
select-top-voted-issue: | |
runs-on: ubuntu-latest | |
permissions: | |
issues: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Select the most voted enhancement | |
id: select-top-voted-issue | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const script = require('./.github/workflows/scripts/selectMostVotedIssue.js') | |
return await script({github, context, core}) | |
- name: Notify MS Teams channel | |
id: notify-ms-teams | |
if: ${{ success() && !steps.select-top-voted-issue.outputs.result == '' }} | |
uses: simbo/msteams-message-card-action@latest | |
with: | |
webhook: ${{ secrets.COMMUNITY_EVENTS_WEBHOOK_URL }} | |
title: An Enhancement Proposal Issue has been selected the top-voted issue! | |
message: <code>${{ fromJSON(steps.select-top-voted-issue.outputs.result).title }}</code> assigned to <strong>${{ fromJSON(steps.select-top-voted-issue.outputs.result).assignee }}</strong> | |
buttons: | | |
View Issue on GitHub ${{ fromJSON(steps.select-top-voted-issue.outputs.result).url }} | |
close-forgotten-voting-issues: | |
runs-on: ubuntu-latest | |
permissions: | |
issues: write | |
needs: select-top-voted-issue | |
env: | |
maximumVotingThreshold: ${{ vars.MAX_VOTING_THRESHOLD_DAYS }} | |
steps: | |
- name: Check environment | |
run: | | |
if [ -z $maximumVotingThreshold ]; then | |
echo "::error::'MAX_VOTING_THRESHOLD_DAYS' environment variable is not set" | |
exit 1 | |
fi | |
- uses: actions/checkout@v3 | |
if: success() | |
- name: Close "forgotten" enhancement requests | |
id: close-forgotten-enhancements | |
if: success() | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const script = require('./.github/workflows/scripts/closeForgottenEnhancements.js') | |
script({github, context, core}) |