From 65f7b447009ce6f9f0d72e93ffe0fed6f9b303c5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 27 Dec 2025 22:38:04 +0000 Subject: [PATCH 1/2] Initial plan From 6e94f26044a5195143b02f52eeabb15468efe12f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 27 Dec 2025 22:41:36 +0000 Subject: [PATCH 2/2] Add workflow step to close issues when models are up-to-date and trigger on JSON file changes Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com> --- .github/workflows/check-models.yml | 43 ++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/.github/workflows/check-models.yml b/.github/workflows/check-models.yml index 35519706..3120d326 100644 --- a/.github/workflows/check-models.yml +++ b/.github/workflows/check-models.yml @@ -6,6 +6,8 @@ on: paths: - .github/workflows/check-models.yml - .github/scripts/scrape-models.sh + - src/tokenEstimators.json + - src/modelPricing.json schedule: - cron: '11 17 * * 1' # Run every Monday at 5:11 PM UTC @@ -180,3 +182,44 @@ jobs: }); console.log('Created a new GitHub issue for missing models.'); } + + - name: Close GitHub Issue if all models are up-to-date + if: steps.check_missing.outputs.needs_update == 'false' + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { owner, repo } = context.repo; + + // Find open issues with the specific title and labels + const { data: issues } = await github.rest.issues.listForRepo({ + owner, + repo, + state: 'open', + labels: 'maintenance', + creator: 'github-actions[bot]' + }); + + const title = '🤖 Action Required: Update Copilot Supported Models'; + const existingIssue = issues.find(issue => issue.title === title); + + if (existingIssue) { + // Close the issue with a comment + await github.rest.issues.createComment({ + owner, + repo, + issue_number: existingIssue.number, + body: '✅ All Copilot models are now up-to-date. All models from the [GitHub Copilot documentation](https://docs.github.com/en/copilot/reference/ai-models/supported-models) are present in both `tokenEstimators.json` and `modelPricing.json`.\n\nClosing this issue automatically.' + }); + + await github.rest.issues.update({ + owner, + repo, + issue_number: existingIssue.number, + state: 'closed' + }); + + console.log(`Closed issue #${existingIssue.number} as all models are now up-to-date.`); + } else { + console.log('No open issue found to close. All models are already up-to-date.'); + }