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