From dd7d9b5170e6a7275ac54ccfff8641b3bc24d22d Mon Sep 17 00:00:00 2001 From: heznpc Date: Sat, 11 Apr 2026 14:01:38 +0900 Subject: [PATCH 1/2] fix: sort imports in __main__.py (ruff) and bump cd.yml checkout - src/my_mcp_server/__main__.py: ruff was failing on every PR because 'import sys' came before 'import logging' (stdlib imports should be sorted). CI never passed. Swap the two lines. - .github/workflows/cd.yml: bump actions/checkout from v4 to v6 to match ci.yml. --- .github/workflows/cd.yml | 2 +- src/my_mcp_server/__main__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 6a09098..daade59 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -19,7 +19,7 @@ jobs: contents: write id-token: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-tags: true diff --git a/src/my_mcp_server/__main__.py b/src/my_mcp_server/__main__.py index 8633a6c..3a27a02 100644 --- a/src/my_mcp_server/__main__.py +++ b/src/my_mcp_server/__main__.py @@ -1,7 +1,7 @@ """Allow running as ``python -m my_mcp_server``.""" -import sys import logging +import sys from my_mcp_server.server import main From fc19f01cf7fb4a34ccb4436d9c64f0c335e47447 Mon Sep 17 00:00:00 2001 From: heznpc Date: Sat, 11 Apr 2026 20:52:59 +0900 Subject: [PATCH 2/2] ci: close maintenance issue when CI is green The existing open-issue-on-failure job opened a `maintenance` labeled issue whenever the weekly CI run broke, but there was no counterpart job to close that issue once the underlying problem got fixed. As a result the 12 starters accumulated stale open issues that made the repos look broken to outside visitors even after every fix had landed. The new close-issue-on-success job runs whenever the re-triggered CI is green, lists all open issues with the `maintenance` label, leaves a comment linking back to the resolving run, and closes them. Future regressions will reopen a fresh issue, so no signal is lost. --- .github/workflows/maintenance.yml | 44 +++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/.github/workflows/maintenance.yml b/.github/workflows/maintenance.yml index 2d639b4..7a8f85e 100644 --- a/.github/workflows/maintenance.yml +++ b/.github/workflows/maintenance.yml @@ -46,3 +46,47 @@ jobs: `---\n_Opened automatically by the Maintenance workflow._`, labels: ['maintenance'], }); + + close-issue-on-success: + needs: ci + if: success() + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v7 + with: + script: | + // Close any open maintenance issues — the most recent CI run + // proves the underlying problem is resolved. Without this job + // the issues opened by `open-issue-on-failure` linger forever + // and the repo looks broken to outside visitors even after the + // fix lands. + const open = await github.rest.issues.listForRepo({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open', + labels: 'maintenance', + }); + if (open.data.length === 0) { + console.log('No open maintenance issues to close.'); + return; + } + const run = await github.rest.actions.getWorkflowRun({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: context.runId, + }); + for (const issue of open.data) { + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issue.number, + body: `Maintenance CI is green again — closing automatically.\n\n**Run:** ${run.data.html_url}`, + }); + await github.rest.issues.update({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issue.number, + state: 'closed', + }); + console.log(`Closed issue #${issue.number}`); + }