feat: auto-forward github-token as GITHUB_APM_PAT + document private repo auth#19
Merged
danielmeppiel merged 2 commits intomainfrom Mar 22, 2026
Merged
Conversation
…repo auth Co-authored-by: danielmeppiel <51440732+danielmeppiel@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/apm-action/sessions/5c0c92eb-f561-420f-88f1-1a5d3faef792
Copilot
AI
changed the title
[WIP] Auto-forward github-token as GITHUB_APM_PAT and document private repo auth
feat: auto-forward github-token as GITHUB_APM_PAT + document private repo auth
Mar 21, 2026
There was a problem hiding this comment.
Pull request overview
This PR reduces GitHub Actions authentication friction by automatically forwarding the existing github-token input into APM’s expected GITHUB_APM_PAT environment variable (without overriding explicit job-level env), and documents the recommended auth patterns for private repos.
Changes:
- Forward
github-tokentoprocess.env.GITHUB_APM_PATusing??=so explicitenv: GITHUB_APM_PATretains priority. - Extend runner tests to cover setting/not-setting/not-clobbering
GITHUB_APM_PAT. - Document private repo authentication tiers in the README and add the previously-undocumented
github-tokeninput to the Inputs table.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/runner.ts | Auto-forwards github-token to GITHUB_APM_PAT (in addition to GITHUB_TOKEN) while preserving pre-set env values. |
| src/tests/runner.test.ts | Adds coverage for GITHUB_APM_PAT forwarding behavior and “do not clobber” semantics. |
| README.md | Documents private repo auth scenarios and adds github-token to the Inputs table. |
| dist/index.js | Updates bundled action output to reflect the new env forwarding behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub Actions forbids secrets with the
GITHUB_prefix, so users couldn't setGITHUB_APM_PATdirectly and had to manually wire up differently-named secrets — unnecessary friction for the common case.Changes
src/runner.ts— Forwardgithub-tokeninput toGITHUB_APM_PATvia??=, so an explicitenv: GITHUB_APM_PATalways wins:Same-org private repos now work with zero config since
github-tokendefaults to${{ github.token }}.src/__tests__/runner.test.ts— Extended existing token-forwarding tests to assertGITHUB_APM_PATis set/not-set/not-clobbered; added a dedicateddoes not clobber existing GITHUB_APM_PAT from job-level envtest.README.md— Added Private repo authentication section documenting the three tiers:Also added
github-tokento the Inputs table (it existed inaction.ymlbut was undocumented in the README).💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.