Skip to content

Commit 412e151

Browse files
authored
chore: quality review fixes + maintenance auto-close (#6)
* fix: bump-version log output and deploy script hardcoded project name - scripts/bump-version.js: the success log always printed 'new → new' because it read pkg.version after mutating it, then .replace()'d next with itself. Save the previous version before mutation so the log correctly shows 'old → new'. - package.json deploy script hardcoded '--project-name my-site'. If a user renamed the package, local 'npm run deploy' would silently target the wrong Cloudflare Pages project. Use \$npm_package_name so the deploy target follows the package name automatically. - Add Python MCP Server to the Related Starters list; bold current. * 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.
1 parent 8dc9333 commit 412e151

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/maintenance.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,47 @@ jobs:
4848
`---\n_Opened automatically by the Maintenance workflow._`,
4949
labels: ['maintenance'],
5050
});
51+
52+
close-issue-on-success:
53+
needs: ci
54+
if: success()
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/github-script@v7
58+
with:
59+
script: |
60+
// Close any open maintenance issues — the most recent CI run
61+
// proves the underlying problem is resolved. Without this job
62+
// the issues opened by `open-issue-on-failure` linger forever
63+
// and the repo looks broken to outside visitors even after the
64+
// fix lands.
65+
const open = await github.rest.issues.listForRepo({
66+
owner: context.repo.owner,
67+
repo: context.repo.repo,
68+
state: 'open',
69+
labels: 'maintenance',
70+
});
71+
if (open.data.length === 0) {
72+
console.log('No open maintenance issues to close.');
73+
return;
74+
}
75+
const run = await github.rest.actions.getWorkflowRun({
76+
owner: context.repo.owner,
77+
repo: context.repo.repo,
78+
run_id: context.runId,
79+
});
80+
for (const issue of open.data) {
81+
await github.rest.issues.createComment({
82+
owner: context.repo.owner,
83+
repo: context.repo.repo,
84+
issue_number: issue.number,
85+
body: `Maintenance CI is green again — closing automatically.\n\n**Run:** ${run.data.html_url}`,
86+
});
87+
await github.rest.issues.update({
88+
owner: context.repo.owner,
89+
repo: context.repo.repo,
90+
issue_number: issue.number,
91+
state: 'closed',
92+
});
93+
console.log(`Closed issue #${issue.number}`);
94+
}

0 commit comments

Comments
 (0)