Skip to content

Create monthly issues #1

Create monthly issues

Create monthly issues #1

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 *An external link was removed to protect your privacy.* for \`dotnet/docs-aspire\`
- [ ] Fix build suggestions in \`dotnet/docs-aspire\`
- [ ] Check *An external link was removed to protect your privacy.* for \`dotnet/docs-aspire\`
- [ ] Approve/merge CleanRepo PR
- [ ] Clean up hygiene items in *An external link was removed to protect your privacy.*
> [!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.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: issueTitle,
body: issueBody,
labels: ['Pri1', '⚙️ repo-maintenance'],
assignees: ['IEvangelist']
});