From b494dba8eda4ca8d9317dcf23edafdd895a9cbb2 Mon Sep 17 00:00:00 2001 From: Bohdan Triapitsyn Date: Wed, 10 Jun 2026 02:20:05 +0300 Subject: [PATCH] ci: use app token for remaining automation --- .github/workflows/oc-integration.yml | 9 +++++++++ .github/workflows/opencode.yml | 9 +++++++++ .github/workflows/reproduce-issue.yml | 12 ++++++++++-- .github/workflows/stale.yml | 8 ++++++++ 4 files changed, 36 insertions(+), 2 deletions(-) diff --git a/.github/workflows/oc-integration.yml b/.github/workflows/oc-integration.yml index 8281186e..8a71c9ed 100644 --- a/.github/workflows/oc-integration.yml +++ b/.github/workflows/oc-integration.yml @@ -22,6 +22,13 @@ jobs: pull-requests: write issues: write steps: + - name: Generate bot app token + id: app-token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ secrets.OC_REVIEW_APP_ID }} + private-key: ${{ secrets.OC_REVIEW_APP_PRIVATE_KEY }} + - name: Checkout repository uses: actions/checkout@v6 with: @@ -30,6 +37,8 @@ jobs: - name: Run opencode uses: anomalyco/opencode/github@latest env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} with: model: opencode/gpt-5.2-codex diff --git a/.github/workflows/opencode.yml b/.github/workflows/opencode.yml index 7f2c00cc..a11db874 100644 --- a/.github/workflows/opencode.yml +++ b/.github/workflows/opencode.yml @@ -22,6 +22,13 @@ jobs: pull-requests: read issues: read steps: + - name: Generate bot app token + id: app-token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ secrets.OC_REVIEW_APP_ID }} + private-key: ${{ secrets.OC_REVIEW_APP_PRIVATE_KEY }} + - name: Checkout repository uses: actions/checkout@v6 with: @@ -30,6 +37,8 @@ jobs: - name: Run opencode uses: anomalyco/opencode/github@latest env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} with: model: opencode-go/deepseek-v4-pro diff --git a/.github/workflows/reproduce-issue.yml b/.github/workflows/reproduce-issue.yml index 089de0fb..5474f15e 100644 --- a/.github/workflows/reproduce-issue.yml +++ b/.github/workflows/reproduce-issue.yml @@ -15,10 +15,18 @@ jobs: contents: write issues: write steps: + - name: Generate bot app token + id: app-token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ secrets.OC_REVIEW_APP_ID }} + private-key: ${{ secrets.OC_REVIEW_APP_PRIVATE_KEY }} + - name: Checkout repository uses: actions/checkout@v6 with: fetch-depth: 1 + token: ${{ steps.app-token.outputs.token }} - name: Setup Bun uses: oven-sh/setup-bun@v2 @@ -32,8 +40,8 @@ jobs: - name: Reproduce issue env: OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ steps.app-token.outputs.token }} + GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} ISSUE_URL: ${{ github.event.issue.html_url }} ISSUE_NUMBER: ${{ github.event.issue.number }} ISSUE_TITLE: ${{ github.event.issue.title }} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 21717671..a0082c05 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -13,8 +13,16 @@ jobs: stale: runs-on: ubuntu-latest steps: + - name: Generate bot app token + id: app-token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ secrets.OC_REVIEW_APP_ID }} + private-key: ${{ secrets.OC_REVIEW_APP_PRIVATE_KEY }} + - uses: actions/stale@v10 with: + repo-token: ${{ steps.app-token.outputs.token }} days-before-stale: 60 days-before-close: 7 stale-issue-label: stale