From 9648b428f4d549fa686f4f1f1c725dfe1e2dd357 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 1 Nov 2026 22:38:53 +0000 Subject: [PATCH 1/2] Initial plan From 3926ef13fe328f9ffd98e4b3e841a4d4a0db10d4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 1 Nov 2026 22:44:12 +0000 Subject: [PATCH 2/2] Fix repo cleanup token and repository targeting Co-authored-by: ballsop <47333194+ballsop@users.noreply.github.com> --- .github/workflows/scheduled-maintenance.yml | 27 ++++++++------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/.github/workflows/scheduled-maintenance.yml b/.github/workflows/scheduled-maintenance.yml index 2f370a4..c73c4cf 100644 --- a/.github/workflows/scheduled-maintenance.yml +++ b/.github/workflows/scheduled-maintenance.yml @@ -24,27 +24,20 @@ on: jobs: repo_cleanup: runs-on: ubuntu-latest + permissions: + contents: write + issues: write + pull-requests: write steps: - - name: Generate Token - id: app-token - uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 - with: - app-id: ${{ vars.MU_ACCESS_APP_ID }} - private-key: ${{ secrets.MU_ACCESS_APP_PRIVATE_KEY }} - owner: ${{ github.repository_owner }} - - - name: Get Repository Info - run: echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV - - name: Prune Won't Fix Pull Requests env: - GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} - REPOSITORY: ${{ env.REPOSITORY_NAME }} + GITHUB_TOKEN: ${{ github.token }} + REPOSITORY: ${{ github.repository }} run: | gh api \ -H "Accept: application/vnd.github+json" \ - /repos/microsoft/${REPOSITORY}/pulls | jq -r '.[]' | jq -rc '.html_url,.labels' | \ + /repos/${REPOSITORY}/pulls | jq -r '.[]' | jq -rc '.html_url,.labels' | \ while read -r html_url ; do read -r labels if [[ $labels == *"state:wont-fix"* ]]; then @@ -54,12 +47,12 @@ jobs: - name: Prune Won't Fix Issues env: - GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} - REPOSITORY: ${{ env.REPOSITORY_NAME }} + GITHUB_TOKEN: ${{ github.token }} + REPOSITORY: ${{ github.repository }} run: | gh api \ -H "Accept: application/vnd.github+json" \ - /repos/microsoft/${REPOSITORY}/issues | jq -r '.[]' | jq -rc '.html_url,.labels' | \ + /repos/${REPOSITORY}/issues | jq -r '.[]' | jq -rc '.html_url,.labels' | \ while read -r html_url ; do read -r labels if [[ $labels == *"state:wont-fix"* ]]; then