From 74a7682fdb4a38384d84c5c7639ffb01329db937 Mon Sep 17 00:00:00 2001 From: Salman Chishti Date: Mon, 9 Mar 2026 05:01:43 -0700 Subject: [PATCH] Add integration test for getOctokit client creation --- .github/workflows/integration.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index ef08747..fe36d96 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -180,6 +180,36 @@ jobs: fi echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY + test-get-octokit: + name: 'Integration test: getOctokit with token' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/install-dependencies + - id: secondary-client + name: Create a second client with getOctokit + uses: ./ + env: + APP_TOKEN: ${{ github.token }} + with: + script: | + const appOctokit = getOctokit(process.env.APP_TOKEN) + const {data} = await appOctokit.rest.repos.get({ + owner: context.repo.owner, + repo: context.repo.repo + }) + + return `${appOctokit !== github}:${data.full_name}` + result-encoding: string + - run: | + echo "- Validating secondary client output" + expected="true:actions/github-script" + if [[ "${{steps.secondary-client.outputs.result}}" != "$expected" ]]; then + echo $'::error::\u274C' "Expected '$expected', got ${{steps.secondary-client.outputs.result}}" + exit 1 + fi + echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY + test-debug: strategy: matrix: