Create monthly issues #3
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: 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@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | |
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'] | |
}); |