|
| 1 | +Below is a consolidated, step-by-step guide and the complete, updated code to implement an automated process that: |
| 2 | + |
| 3 | +- Ensures a monthly “GitHub Triage: YYYY-MM” issue exists and closes last month’s issue if still open |
| 4 | +- Posts weekly comments to the current month’s triage issue, listing and categorizing issues opened in the last 7 days, with each issue reference on its own line |
| 5 | +- Provides a reusable composite action for triage issue creation/closing |
| 6 | +- Offers a workflow that uses the composite action |
| 7 | +- Follow the steps and use the files exactly as provided. |
| 8 | + |
| 9 | +Step-by-step implementation guide |
| 10 | + |
| 11 | +1. Choose your branch and prepare directories |
| 12 | +- Decide your branch (example: update-monthly-review). |
| 13 | +- Ensure you have the following directories: |
| 14 | +-- .github/workflows |
| 15 | +-- .github/actions/triage-issue |
| 16 | + |
| 17 | +2. Add the monthly triage workflow (creates current month’s triage issue and closes previous) |
| 18 | +- This workflow runs monthly. It ensures an issue titled “GitHub Triage: YYYY-MM” exists and closes last month’s triage issue if it is still open. |
| 19 | + |
| 20 | +3. Add the weekly triage comment workflow |
| 21 | +- This runs weekly and posts a comment to the current month’s triage issue with: |
| 22 | +-- Counts by category |
| 23 | +-- A list of each new issue in the last 7 days with one line per issue (e.g., “- #223”) |
| 24 | +-- A note that Mona (Copilot) reviewed |
| 25 | +- It uses JavaScript via actions/github-script and the GitHub Search API (created:>=YYYY-MM-DD). |
| 26 | + |
| 27 | +4. Add the reusable composite action |
| 28 | +- Encapsulates logic to: |
| 29 | +-- Optionally close last month’s triage issue |
| 30 | +--Create the current month’s triage issue |
| 31 | +- This makes future reuse and refactoring easier. |
| 32 | + |
| 33 | +5. Add a workflow that uses the composite action |
| 34 | +- Example monthly workflow that calls the composite action instead of embedding the logic directly. |
| 35 | +- Useful for decoupling and reusability. |
| 36 | + |
| 37 | +6. Commit and push |
| 38 | +- Add all files. |
| 39 | +- Commit with a message, such as: add monthly triage + weekly review workflows |
| 40 | +- Push to your branch. |
| 41 | + |
| 42 | +7. Validate and optionally trigger |
| 43 | +- Go to the GitHub repository’s Actions tab. |
| 44 | +- Confirm workflows are present. |
| 45 | +- Manually trigger them if desired via workflow_dispatch. |
| 46 | +- Confirm labels and issue creation/comments work. |
| 47 | + |
| 48 | +8. Future enhancements |
| 49 | +- Pagination beyond 1000 items if needed. |
| 50 | +- Slack/Teams notifications. |
| 51 | +- GraphQL query optimization for exact-title lookups. |
| 52 | +- NLP-based categorization improvements. |
| 53 | +- JSON artifact uploads for reports and dashboards. |
| 54 | +- Templating: externalize comment templates into env vars or repository files. |
0 commit comments