From 02db9444e265e034de523fb6874b7450744563f5 Mon Sep 17 00:00:00 2001 From: Stephen Belanger Date: Wed, 25 Nov 2026 04:46:43 +0800 Subject: [PATCH] ci: use braintrust-bot for generated pull requests --- .github/workflows/release-bump-pr.yml | 17 ++++++++++++++--- .github/workflows/update-rust-dependencies.yml | 16 +++++++++++++--- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-bump-pr.yml b/.github/workflows/release-bump-pr.yml index 6817d4cd..12a6439e 100644 --- a/.github/workflows/release-bump-pr.yml +++ b/.github/workflows/release-bump-pr.yml @@ -9,18 +9,27 @@ on: type: string permissions: - contents: write - pull-requests: write + contents: read jobs: open-pr: runs-on: ubuntu-22.04 env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} VERSION: ${{ inputs.version }} steps: + # App-authenticated pushes and PRs let pull_request CI start automatically. + - name: Generate app token + id: app-token + uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 + with: + app-id: ${{ secrets.BRAINTRUST_BOT_APP_ID }} + private-key: ${{ secrets.BRAINTRUST_BOT_PRIVATE_KEY }} + permission-contents: write + permission-pull-requests: write + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: + token: ${{ steps.app-token.outputs.token }} fetch-depth: 0 - name: Validate version @@ -101,6 +110,8 @@ jobs: git push --force-with-lease origin "${BRANCH}" - name: Open pull request + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} shell: bash run: | set -euo pipefail diff --git a/.github/workflows/update-rust-dependencies.yml b/.github/workflows/update-rust-dependencies.yml index 4bc8d185..162b7419 100644 --- a/.github/workflows/update-rust-dependencies.yml +++ b/.github/workflows/update-rust-dependencies.yml @@ -15,8 +15,7 @@ on: default: true permissions: - contents: write - pull-requests: write + contents: read concurrency: group: update-rust-dependencies @@ -26,15 +25,25 @@ jobs: update: runs-on: ubuntu-24.04 env: - GH_TOKEN: ${{ github.token }} BRANCH: automation/update-rust-dependencies UPDATE_RUST_SDK: ${{ inputs.update_rust_sdk }} UPDATE_BT_DAEMON: ${{ inputs.update_bt_daemon }} SDK_REPOSITORY: braintrustdata/braintrust-sdk-rust DAEMON_REPOSITORY: braintrustdata/braintrust-coding-agent-plugins steps: + # App-authenticated pushes and PRs let pull_request CI start automatically. + - name: Generate app token + id: app-token + uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 + with: + app-id: ${{ secrets.BRAINTRUST_BOT_APP_ID }} + private-key: ${{ secrets.BRAINTRUST_BOT_PRIVATE_KEY }} + permission-contents: write + permission-pull-requests: write + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: + token: ${{ steps.app-token.outputs.token }} fetch-depth: 0 ref: main @@ -119,6 +128,7 @@ jobs: - name: Commit and open pull request env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} SDK_SHA: ${{ steps.dependencies.outputs.sdk_sha }} DAEMON_SHA: ${{ steps.dependencies.outputs.daemon_sha }} shell: bash