Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/rig-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ jobs:
- name: Run integration tests
env:
RIG_REQUIRE_COPILOT_INTEGRATION: "1"
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN || github.token }}
run: npm run test:integration
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ node skills/rig/run.ts review.ts --typecheck

## Live Copilot integration tests

Run `npm run test:integration` with `COPILOT_GITHUB_TOKEN` for the local CLI transport, or with `COPILOT_SDK_URI` for a running SDK endpoint (also supply `COPILOT_CONNECTION_TOKEN` if the endpoint requires it). Without either transport, the suite reports a skip. Set `RIG_REQUIRE_COPILOT_INTEGRATION=1` to fail instead, as the Rig Integration Tests workflow does.
Run `npm run test:integration` with `COPILOT_GITHUB_TOKEN` for the local CLI transport, or with `COPILOT_SDK_URI` for a running SDK endpoint (also supply `COPILOT_CONNECTION_TOKEN` if the endpoint requires it). Without either transport, the suite reports a skip. Set `RIG_REQUIRE_COPILOT_INTEGRATION=1` to fail instead, as the Rig Integration Tests workflow does. That workflow uses the `COPILOT_GITHUB_TOKEN` secret when configured, otherwise its automatic `github.token` with `copilot-requests: write` permission.

## In agentic workflows

Expand Down
16 changes: 16 additions & 0 deletions src/rig-integration-workflow.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";

const workflow = readFileSync(new URL("../.github/workflows/rig-integration.yml", import.meta.url), "utf8");

describe("Rig Integration Tests workflow", () => {
it("falls back to the workflow token with Copilot request permission", () => {
expect(workflow).toContain("COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN || github.token }}");
expect(workflow).toContain("copilot-requests: write");
});

it("requires live integration rather than silently skipping tests", () => {
expect(workflow).toContain('RIG_REQUIRE_COPILOT_INTEGRATION: "1"');
expect(workflow).toContain("run: npm run test:integration");
});
});