Skip to content

Commit c8d8bc3

Browse files
krukowCopilot
andcommitted
Export COPILOT_GITHUB_TOKEN in copilot-setup-steps for E2E tests
Set COPILOT_GITHUB_TOKEN in GITHUB_ENV during setup so all Copilot Coding Agent sessions (and agentic workflows) can run E2E tests and examples with the same token. Also document this in copilot-instructions.md. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f74a94c commit c8d8bc3

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

.github/copilot-instructions.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ bb test
7070
COPILOT_E2E_TESTS=true bb test
7171
```
7272

73+
**Copilot Coding Agent**: When running as a Copilot Coding Agent, `COPILOT_GITHUB_TOKEN` is set
74+
by `copilot-setup-steps.yml`. Use it to authenticate E2E tests and examples:
75+
76+
```bash
77+
export COPILOT_GITHUB_TOKEN="${COPILOT_GITHUB_TOKEN:-$GITHUB_TOKEN}"
78+
COPILOT_E2E_TESTS=true bb test
79+
./run-all-examples.sh
80+
```
81+
7382
### Instrumented Testing
7483

7584
All public API functions have `clojure.spec` fdefs defined in `instrument.clj`.

.github/workflows/copilot-setup-steps.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ jobs:
7373
# /root/ paths, so bb finds them regardless of $HOME.
7474
# Ensure deps directories are readable by any user
7575
chmod -R a+rX ~/.m2/repository ~/.deps.clj 2>/dev/null || true
76+
- name: Export Copilot token for SDK E2E tests
77+
run: |
78+
# Make the GitHub token available as COPILOT_GITHUB_TOKEN so the
79+
# Copilot SDK E2E tests and examples can authenticate with the
80+
# same token the Copilot Coding Agent uses.
81+
echo "COPILOT_GITHUB_TOKEN=${COPILOT_GITHUB_TOKEN:-$GITHUB_TOKEN}" >> "$GITHUB_ENV"
7682
- name: Install gh-aw extension
7783
uses: github/gh-aw/actions/setup-cli@v0.48.1
7884
with:

.github/workflows/daily-doc-updater.lock.yml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/upstream-sync.lock.yml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)