Skip to content
This repository was archived by the owner on Aug 24, 2026. It is now read-only.

Avoid GitHub Actions errors when run URL fields are missing - #292

Merged
pda merged 1 commit into
mainfrom
fix-missing-github-actions-url
Aug 24, 2026
Merged

Avoid GitHub Actions errors when run URL fields are missing#292
pda merged 1 commit into
mainfrom
fix-missing-github-actions-url

Conversation

@pda

@pda pda commented Aug 24, 2026

Copy link
Copy Markdown
Member

Why

When GitHub Actions is detected from GITHUB_RUN_NUMBER but GITHUB_REPOSITORY or GITHUB_RUN_ID is absent, the collector passes nil to File.join and raises a TypeError while gathering CI metadata.

What

Build the run URL only when both fields are available; otherwise return a nil URL, consistent with unavailable URLs from other CI providers. Regression tests cover each missing field independently.

Fixes #282

GitHub Actions detection only requires GITHUB_RUN_NUMBER, so the
repository or run ID can be absent when CI metadata is collected. Avoid
passing those nil values to File.join and return a nil run URL instead,
matching the existing behavior for unavailable CI URLs.

Cover each missing environment variable independently to prevent the
TypeError from regressing.

Amp-Thread-ID: https://ampcode.com/threads/T-01a0338e-1aac-70df-b672-9eb6ef2afcd8
Co-authored-by: Amp <amp@ampcode.com>
@pda
pda requested a review from a team as a code owner August 24, 2026 11:39
@pda
pda merged commit 1ecde6d into main Aug 24, 2026
4 checks passed
@pda
pda deleted the fix-missing-github-actions-url branch August 24, 2026 11:44
pda added a commit to buildkite/bktest that referenced this pull request Aug 24, 2026
…ix-missing-github-actions-url

Avoid GitHub Actions errors when run URL fields are missing
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

github_actions raises TypeError when GITHUB_REPOSITORY or GITHUB_RUN_ID is unset

1 participant