Skip to content

feat: expose the run id as a GitHub Actions step output - #551

Open
moha-bekh wants to merge 3 commits into
mainfrom
cod-3661-expose-the-run-id-as-an-output-of-the-runner-and-the-github
Open

moha-bekh wants to merge 3 commits into
mainfrom
cod-3661-expose-the-run-id-as-an-output-of-the-runner-and-the-github

Conversation

@moha-bekh

Copy link
Copy Markdown
Member

After a successful upload on GitHub Actions, write the CodSpeed run id to $GITHUB_OUTPUT as run-id, so later workflow steps can read the run back instead of guessing it from the commit and branch.

All uploads of a workflow run land in the same CodSpeed run, so the id of the last upload is the run id. Failing to write the output only logs a warning.

The action will expose it as a run-id output once this is released.

Closes COD-3661

A workflow step running after the benchmarks had no way to know which
CodSpeed run the results were uploaded to. After a successful upload on
GitHub Actions, write it to `$GITHUB_OUTPUT` as `run-id`.

All uploads of a workflow run share the same CodSpeed run, so the id of
the last upload is the run id. A failure to write the output only warns.

Closes COD-3661
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codspeed

codspeed Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 17.56%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

❌ 1 regressed benchmark
✅ 32 untouched benchmarks
⏩ 4 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ WallTime memtrack track tar 8 s 9.7 s -17.56%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing cod-3661-expose-the-run-id-as-an-output-of-the-runner-and-the-github (9ac0bbb) with main (7c135cc)

Open in CodSpeed

Footnotes

  1. 4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Writing to `$GITHUB_OUTPUT` on every upload would add a `run-id` output
to any user `run:` step invoking the runner. Gate it behind
`--export-run-id` / `CODSPEED_EXPORT_RUN_ID`, set by the CodSpeed action.

Refs COD-3661
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@moha-bekh
moha-bekh marked this pull request as ready for review September 28, 2026 12:55
@greptile-apps

greptile-apps Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Adds run ID export to GitHub Actions step outputs.

The PR appears safe to merge; no outstanding findings remain.

Summary

The PR adds an opt-in run-id GitHub Actions step output after successful uploads.

  • Both benchmark commands pass the option to the orchestrator.
  • The GitHub Actions provider appends the uploaded run ID to GITHUB_OUTPUT; write failures produce a warning without failing the run.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[run or exec] --> B[Upload completed parts]
  B --> C[Last upload's run ID]
  C --> D{Export enabled?}
  D -- Yes --> E[Append run-id to GITHUB_OUTPUT]
  E -- Write fails --> F[Log warning; continue]
Loading

Reviews (2) · Last reviewed commit: "fix: warn when the run id cannot be expo..."

Comment thread src/run_environment/github_actions/provider.rs Outdated
Comment thread src/run_environment/github_actions/provider.rs
Now that the export is opt-in, a missing `$GITHUB_OUTPUT` means the
caller asked for a `run-id` output that will never be written. Surface
it as a warning instead of silently skipping.

Refs COD-3661
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant