Skip to content

feat: add monthly milestone bot with Discord notification#2087

Open
Patrick-Augusto wants to merge 7 commits into
ruxailab:developfrom
Patrick-Augusto:feature/monthly-milestone-automation
Open

feat: add monthly milestone bot with Discord notification#2087
Patrick-Augusto wants to merge 7 commits into
ruxailab:developfrom
Patrick-Augusto:feature/monthly-milestone-automation

Conversation

@Patrick-Augusto

@Patrick-Augusto Patrick-Augusto commented May 31, 2026

Copy link
Copy Markdown

Feature Description 📝

A bot-driven automation system that creates a new GitHub Milestone every month with predefined objectives, and automatically posts a formatted summary to a dedicated Discord channel.

📊 Bot Workflow Diagram

Milestone Bot Flowchart

Motivation 🌟

Currently, monthly milestones are created manually, which introduces delays, formatting inconsistencies, and limited community visibility. This automation:

  • ✅ Ensures milestones are created on a consistent schedule (1st of each month at 08:00 UTC)
  • ✅ Reduces maintainer overhead
  • ✅ Keeps the Discord community proactively informed
  • ✅ Improves project transparency and contributor engagement

Changes

New Files (4 files, 0 existing files modified)

File Purpose
milestone-config.yml Config at repo root — maintainers edit monthly objectives here before the 1st
.github/scripts/create-monthly-milestone.js Main automation script with 3 redundancy layers
.github/workflows/monthly-milestone.yml Workflow with cron schedule + manual dispatch
.github/milestone_bot_flowchart.png Visual workflow flowchart embedded above

Redundancy Layers

Layer Primary Fallback
YAML Parsing yaml npm package Built-in line-by-line parser (zero deps)
Config File milestone-config.yml Hardcoded defaults in script
Month Objectives Month-specific key default_objectives from config
Milestone Creation POST create On HTTP 422 → GET + PATCH update (idempotent)
Discord Webhook Single POST Retry 3× with exponential backoff

How It Works

  1. On the 1st of each month (or manual trigger), the bot:

    • Creates a GitHub Milestone named Month YYYY with a due date on the last day of that month
    • Populates its description with objectives from milestone-config.yml
  2. Upon milestone creation, posts to Discord with:

    • Milestone title and due date
    • List of monthly objectives
    • Direct link to the GitHub Milestone

Setup Required

Note: A repository secret DISCORD_WEBHOOK_URL must be added for Discord notifications. If missing, the milestone is still created — only the notification is skipped.

Testing

  • JavaScript syntax check passed (node -c)
  • YAML lint passed for both .yml files
  • Can be tested via Actions → Monthly Milestone Creator → Run workflow

Fixes #2073

Copilot AI review requested due to automatic review settings May 31, 2026 10:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds an automated monthly milestone creator that runs on the 1st of each month (or manually), reading objectives from a YAML config and notifying Discord on completion.

Changes:

  • New GitHub Actions workflow scheduled monthly with manual dispatch inputs for month/year.
  • New github-script-based JS module that creates/updates a GitHub milestone with layered YAML parsing fallbacks and Discord webhook retries.
  • New milestone-config.yml defining default objectives and per-month overrides.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 7 comments.

File Description
milestone-config.yml Declares default objectives and June 2026 milestone entry.
.github/workflows/monthly-milestone.yml Schedules monthly run, installs yaml package, invokes the script.
.github/scripts/create-monthly-milestone.js Implements config loading, milestone create/update, and Discord notification.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/scripts/create-monthly-milestone.js Outdated
Comment thread .github/scripts/create-monthly-milestone.js Outdated
Comment thread .github/scripts/create-monthly-milestone.js Outdated
Comment thread .github/scripts/create-monthly-milestone.js Outdated
Comment thread .github/workflows/monthly-milestone.yml Outdated
Comment thread .github/scripts/create-monthly-milestone.js
Comment thread .github/scripts/create-monthly-milestone.js Outdated
Copilot AI review requested due to automatic review settings June 4, 2026 08:59
@github-actions github-actions Bot removed the assets label Jun 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

Comment thread .github/workflows/monthly-milestone.yml Outdated
Comment thread .github/workflows/monthly-milestone.yml
Comment thread .github/scripts/create-monthly-milestone.js Outdated
Comment thread .github/scripts/create-monthly-milestone.js
Comment thread .github/scripts/create-monthly-milestone.js Outdated
Comment thread .github/scripts/create-monthly-milestone.js
Copilot AI review requested due to automatic review settings June 6, 2026 20:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

Comment thread .github/workflows/monthly-milestone.yml
Comment thread .github/scripts/create-monthly-milestone.js Outdated
Comment thread .github/scripts/create-monthly-milestone.js
Comment thread .github/scripts/create-monthly-milestone.js Outdated
Patrick-Augusto and others added 7 commits June 6, 2026 23:27
- Add milestone-config.yml for maintainers to define monthly objectives
- Add create-monthly-milestone.js with 3 redundancy layers:
  - YAML parsing fallback (npm yaml -> line-by-line parser -> hardcoded defaults)
  - Idempotent milestone sync (create -> update on conflict)
  - Discord webhook retry with exponential backoff
- Add monthly-milestone.yml workflow (cron: 1st of month at 08:00 UTC + manual dispatch)
…reator

- Remove unused 'i' index from map callback
- Read and respect Discord 'Retry-After' and 'X-RateLimit-Reset-After' rate-limit headers in milliseconds with safety buffer
- Precisely inspect errors for HTTP 422 'already_exists' instead of assuming all 422s are duplicates
- Paginate all pages of milestones via github.paginate instead of limiting to the first page (max 100)
- Install yaml package with --no-save in the workflow to prevent workspace/checkout pollution
- Make fallback YAML line parser extremely robust and permissive (support unquoted values, single/double quotes, and any indentation)
- Change milestone due_on time component to T08:00:00Z to prevent date shifting and match GitHub's default storage format
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
The flowchart PNG was removed by the maintainer in 5cc2807. Drop the
comment that referenced it from monthly-milestone.yml so we don't point
to a file that no longer exists.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Patrick-Augusto Patrick-Augusto force-pushed the feature/monthly-milestone-automation branch from f3f137f to 9ccde09 Compare June 6, 2026 21:34
@github-actions github-actions Bot added Documentation Improvements or additions to documentation medium-complexity size/XL and removed size/L low-complexity labels Jun 6, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jun 6, 2026

Copy link
Copy Markdown

@github-actions github-actions Bot added stale and removed stale labels Jun 14, 2026
@github-actions github-actions Bot added the stale label Jun 23, 2026
@github-actions github-actions Bot removed the stale label Jun 24, 2026
@github-actions github-actions Bot added stale and removed stale labels Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd Documentation Improvements or additions to documentation medium-complexity new-feature New feature or request size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[✨ FEATURE]: Automated monthly milestone creation & Discord announcement bot

3 participants