From 164a088269b5520c0233a59244d2dba6c3a69954 Mon Sep 17 00:00:00 2001 From: Gerald Morrison Date: Wed, 5 Feb 2025 17:37:10 +0100 Subject: [PATCH] use app token because of PR / branch protection --- .github/workflows/milestone.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/milestone.yaml b/.github/workflows/milestone.yaml index 9137df0b3..0dd59d632 100644 --- a/.github/workflows/milestone.yaml +++ b/.github/workflows/milestone.yaml @@ -14,13 +14,19 @@ jobs: issues: write pull-requests: write steps: + - name: Generate token + id: generate_token + uses: tibdex/github-app-token@v2 + with: + app_id: ${{ secrets.OCMBOT_APP_ID }} + private_key: ${{ secrets.OCMBOT_PRIV_KEY }} - name: Set milestone on issue if: github.event.issue.state_reason == 'completed' run: gh issue edit ${{ github.event.issue.number }} --milestone "$(date +"%Y-Q%q")" --repo ${{ github.repository }} env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ steps.generate_token.outputs.token }} - name: Set milestone on pull request if: github.event.pull_request.merged == true run: gh pr edit ${{ github.event.pull_request.number }} --milestone "$(date +"%Y-Q%q")" --repo ${{ github.repository }} env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ steps.generate_token.outputs.token }} # For PRs and branch protection the standard GITHUB_TOKEN is not sufficient \ No newline at end of file