-
Notifications
You must be signed in to change notification settings - Fork 123
59 lines (52 loc) · 2.5 KB
/
create-monthly-issues.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
58
59
name: Create monthly issues
on:
schedule:
- cron: '0 0 24 * *' # Runs at midnight on the 24th of each month
workflow_dispatch:
permissions:
contents: read
jobs:
create-issue:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
with:
egress-policy: audit
- name: Create GitHub Issue
uses: actions/github-script@660ec11d825b714d112a6bb9727086bc2cc500b2 #v7
with:
script: |
const nextMonth = new Date();
const currentMonth = nextMonth.getMonth();
if (currentMonth === 11) { // December
nextMonth.setMonth(0); // January
nextMonth.setFullYear(nextMonth.getFullYear() + 1);
} else {
nextMonth.setMonth(currentMonth + 1);
}
const monthName = nextMonth.toLocaleString('default', { month: 'short' });
const year = nextMonth.getFullYear();
const monthEmojis = ['❄️', '❤️', '🌸', '🌧️', '🌼', '☀️', '🎆', '🌞', '🍂', '🎃', '🍁', '🎄'];
const month = nextMonth.getMonth();
const emoji = monthEmojis[month];
const issueTitle = `${emoji} Repo chores—${monthName} ${year}`;
const issueBody = `
- [ ] Check [UUF feedback](https://aka.ms/uuftriageapp) for `dotnet/docs-aspire`
- [ ] Fix build suggestions in `dotnet/docs-aspire`
- [ ] Check [broken links report](https://msit.powerbi.com/groups/me/reports/0a1183d7-baae-4d5d-9d71-7bb437e2b2b3/ReportSection5885348483cf9c5a907f?ctid=72f988bf-86f1-41af-91ab-2d7cd011db47&experience=power-bi) for `dotnet/docs-aspire`: #1863
- [ ] Approve/merge CleanRepo PR
- [ ] Clean up hygiene items in [ADO board](https://dev.azure.com/msft-skilling/Content/_dashboards/dashboard/8132ec13-0654-4ffd-89a1-a1b9bcd77715)
> [!NOTE]
> 🤖 This issue was created using [.github/workflows/create-monthly-issues.yml](https://github.com/dotnet/docs-aspire/blob/main/.github/workflows/create-monthly-issues.yml).
`;
github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: issueTitle,
body: issueBody,
labels: ['Pri1', '⚙️ repo-maintenance'],
assignees: ['IEvangelist']
});