-
Notifications
You must be signed in to change notification settings - Fork 306
58 lines (57 loc) · 2.15 KB
/
monitor-issues-in-voting.yaml
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
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
env:
issueTitle: ${{ fromJSON(steps.select-top-voted-issue.outputs.result).title }}
issueURL: ${{ fromJSON(steps.select-top-voted-issue.outputs.result).url }}
assignee: ${{ fromJSON(steps.select-top-voted-issue.outputs.result).assignee }}
with:
webhook: ${{ secrets.COMMUNITY_EVENTS_WEBHOOK_URL }}
title: An Enhancement Proposal Issue has been selected the top-voted issue!
message: <code>${{ env.issueTitle }}</code> assigned to <strong>${{ env.assignee }}</strong>
buttons: |
View Issue on GitHub ${{ env.issueURL }}
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})