diff --git a/.github/workflows/ai-policy.yml b/.github/workflows/ai-policy.yml index c86be86..1ccdc1b 100644 --- a/.github/workflows/ai-policy.yml +++ b/.github/workflows/ai-policy.yml @@ -32,7 +32,7 @@ jobs: - name: Collect PR commit messages id: collect env: - GH_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ secrets.COMMAND_BOT_PAT }} COMMITS_URL: ${{ github.event.pull_request.commits_url }} run: | set -euo pipefail @@ -125,7 +125,7 @@ jobs: - name: Create 'AI assisted' label if absent if: steps.ai_trailers.outputs.ai_assisted == 'true' || steps.agent_signoff.outputs.agent_signoff == 'true' || steps.co_authored.outputs.co_authored == 'true' env: - GH_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ secrets.COMMAND_BOT_PAT }} run: | gh api "repos/${{ github.repository }}/labels" \ --method POST \ @@ -137,11 +137,11 @@ jobs: - name: Label PR as AI assisted if: steps.ai_trailers.outputs.ai_assisted == 'true' || steps.agent_signoff.outputs.agent_signoff == 'true' || steps.co_authored.outputs.co_authored == 'true' env: - GH_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ secrets.COMMAND_BOT_PAT }} run: | - gh pr edit "${{ github.event.pull_request.number }}" \ - --repo "${{ github.repository }}" \ - --add-label "AI assisted" + gh api "repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels" \ + --method POST \ + -f "labels[]=AI assisted" echo "Added 'AI assisted' label to PR #${{ github.event.pull_request.number }}" - name: Fail on coding-agent Signed-off-by diff --git a/workflow-templates/ai-policy.yml b/workflow-templates/ai-policy.yml index c86be86..1ccdc1b 100644 --- a/workflow-templates/ai-policy.yml +++ b/workflow-templates/ai-policy.yml @@ -32,7 +32,7 @@ jobs: - name: Collect PR commit messages id: collect env: - GH_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ secrets.COMMAND_BOT_PAT }} COMMITS_URL: ${{ github.event.pull_request.commits_url }} run: | set -euo pipefail @@ -125,7 +125,7 @@ jobs: - name: Create 'AI assisted' label if absent if: steps.ai_trailers.outputs.ai_assisted == 'true' || steps.agent_signoff.outputs.agent_signoff == 'true' || steps.co_authored.outputs.co_authored == 'true' env: - GH_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ secrets.COMMAND_BOT_PAT }} run: | gh api "repos/${{ github.repository }}/labels" \ --method POST \ @@ -137,11 +137,11 @@ jobs: - name: Label PR as AI assisted if: steps.ai_trailers.outputs.ai_assisted == 'true' || steps.agent_signoff.outputs.agent_signoff == 'true' || steps.co_authored.outputs.co_authored == 'true' env: - GH_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ secrets.COMMAND_BOT_PAT }} run: | - gh pr edit "${{ github.event.pull_request.number }}" \ - --repo "${{ github.repository }}" \ - --add-label "AI assisted" + gh api "repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels" \ + --method POST \ + -f "labels[]=AI assisted" echo "Added 'AI assisted' label to PR #${{ github.event.pull_request.number }}" - name: Fail on coding-agent Signed-off-by