diff --git a/.github/workflows/integration-tests.yaml b/.github/workflows/integration-tests.yaml index b8596fd8..0b3b7e21 100644 --- a/.github/workflows/integration-tests.yaml +++ b/.github/workflows/integration-tests.yaml @@ -14,19 +14,32 @@ jobs: pull-requests: write steps: + - name: Generate GitHub App token + id: app-token + uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0 + with: + app-id: ${{ secrets.BRAINTRUST_BOT_APP_ID }} + private-key: ${{ secrets.BRAINTRUST_BOT_PRIVATE_KEY }} + owner: braintrustdata + repositories: | + braintrust + braintrust-sdk-python + permission-contents: write + permission-pull-requests: write + - name: Checkout parent repository uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: repository: braintrustdata/braintrust path: braintrust - token: ${{ secrets.CROSS_REPO_TOKEN }} + token: ${{ steps.app-token.outputs.token }} fetch-depth: 0 - name: Configure Git in parent repository run: | cd braintrust - git config user.name "GitHub Actions Bot" - git config user.email "actions@github.com" + git config user.name "${{ steps.app-token.outputs.app-slug }}[bot]" + git config user.email "${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com" - name: Initialize and update SDK submodule run: | @@ -41,7 +54,7 @@ jobs: - name: Create integration test PR run: ./braintrust/sdk/scripts/create-integration-test-pr.sh env: - GH_TOKEN: ${{ secrets.CROSS_REPO_TOKEN }} + GH_TOKEN: ${{ steps.app-token.outputs.token }} BRANCH_NAME: ${{ github.head_ref || github.ref_name }} COMMIT_HASH: ${{ github.event.pull_request.head.sha }} PARENT_REPO_PATH: braintrust