From 494255e81e55fdc9d34c796d94756502a26967ab Mon Sep 17 00:00:00 2001 From: moha-bekh Date: Mon, 28 Sep 2026 06:16:44 -0400 Subject: [PATCH 1/4] feat: add a run-id output Expose the id of the CodSpeed run the results were uploaded to, so that later steps of the workflow can read the run back. Refs COD-3661 Co-Authored-By: Claude Opus 5.5 --- README.md | 11 +++++++++++ action.yml | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/README.md b/README.md index fda3045..9516fb7 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,17 @@ GitHub Actions for running [CodSpeed](https://codspeed.io) in your CI. experimental-memory-track-physical: "" ``` +The action exposes the id of the CodSpeed run as the `run-id` output (requires runner v5.4.0 or later): + +```yaml +- uses: CodSpeedHQ/action@v5 + id: codspeed + with: + mode: "simulation" + run: "" +- run: echo "CodSpeed run ${{ steps.codspeed.outputs.run-id }}" +``` + # Example usage ## Python with `pytest` and [`pytest-codspeed`](https://github.com/CodSpeedHQ/pytest-codspeed) diff --git a/action.yml b/action.yml index dcc0ac2..4adc29f 100644 --- a/action.yml +++ b/action.yml @@ -112,6 +112,13 @@ inputs: required: false default: "false" +outputs: + run-id: + description: | + The id of the CodSpeed run the results were uploaded to. + Requires runner v5.4.0 or later. + value: ${{ steps.run-benchmarks.outputs.run-id }} + runs: using: "composite" steps: @@ -252,6 +259,7 @@ runs: fi - name: Run the benchmarks + id: run-benchmarks shell: bash env: GH_MATRIX: "${{ toJson(matrix) }}" From 4d66c30cd04756b82e61d4f4c894ef37e4710c9d Mon Sep 17 00:00:00 2001 From: moha-bekh Date: Mon, 28 Sep 2026 08:30:19 -0400 Subject: [PATCH 2/4] feat: ask the runner to export the run id The runner only writes the `run-id` step output when `CODSPEED_EXPORT_RUN_ID` is set. Pass it as an env var rather than a flag so that older pinned runners ignore it instead of failing. Refs COD-3661 Co-Authored-By: Claude Opus 5.5 --- action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/action.yml b/action.yml index 4adc29f..9d377bb 100644 --- a/action.yml +++ b/action.yml @@ -266,6 +266,8 @@ runs: GH_STRATEGY: "${{ toJson(strategy) }}" # This is needed to properly handle quotes and multiline commands in the 'run' input properly, rather than doing `RUN_INPUT_RUN=${{ inputs.run }}` in the script CODSPEED_INPUT_RUN: ${{ inputs.run }} + # Write the run id to the `run-id` output (an env var, so older runners ignore it) + CODSPEED_EXPORT_RUN_ID: "true" run: | # Validate required inputs # (custom message for smoother v4 migration) From 8c4fe782f19e98fed0ccf7c87bcb2a0a29b4cd9a Mon Sep 17 00:00:00 2001 From: moha-bekh Date: Tue, 29 Sep 2026 08:39:42 -0400 Subject: [PATCH 3/4] chore: shorten the run id export comment Co-Authored-By: Claude Opus 5.5 --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 9d377bb..93c0cbf 100644 --- a/action.yml +++ b/action.yml @@ -266,7 +266,7 @@ runs: GH_STRATEGY: "${{ toJson(strategy) }}" # This is needed to properly handle quotes and multiline commands in the 'run' input properly, rather than doing `RUN_INPUT_RUN=${{ inputs.run }}` in the script CODSPEED_INPUT_RUN: ${{ inputs.run }} - # Write the run id to the `run-id` output (an env var, so older runners ignore it) + # An env var rather than a flag, so that older runners ignore it CODSPEED_EXPORT_RUN_ID: "true" run: | # Validate required inputs From 2b8d16a6dd9deb191fda350794832ceac5d4c006 Mon Sep 17 00:00:00 2001 From: moha-bekh Date: Wed, 30 Sep 2026 09:37:03 -0400 Subject: [PATCH 4/4] feat: rely on the runner always exporting the run id The runner now always writes the `run-id` step output, so the `CODSPEED_EXPORT_RUN_ID` env var is no longer needed. Document the output in a dedicated Outputs section of the README. Refs COD-3661 Co-Authored-By: Claude Opus 5.5 --- README.md | 13 ++++--------- action.yml | 2 -- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 9516fb7..6e936e4 100644 --- a/README.md +++ b/README.md @@ -105,16 +105,11 @@ GitHub Actions for running [CodSpeed](https://codspeed.io) in your CI. experimental-memory-track-physical: "" ``` -The action exposes the id of the CodSpeed run as the `run-id` output (requires runner v5.4.0 or later): +# Outputs -```yaml -- uses: CodSpeedHQ/action@v5 - id: codspeed - with: - mode: "simulation" - run: "" -- run: echo "CodSpeed run ${{ steps.codspeed.outputs.run-id }}" -``` +| Name | Description | +| -------- | ----------------------------------------------------------------------------------------- | +| `run-id` | The id of the CodSpeed run the results were uploaded to. Requires runner v5.4.0 or later. | # Example usage diff --git a/action.yml b/action.yml index 93c0cbf..4adc29f 100644 --- a/action.yml +++ b/action.yml @@ -266,8 +266,6 @@ runs: GH_STRATEGY: "${{ toJson(strategy) }}" # This is needed to properly handle quotes and multiline commands in the 'run' input properly, rather than doing `RUN_INPUT_RUN=${{ inputs.run }}` in the script CODSPEED_INPUT_RUN: ${{ inputs.run }} - # An env var rather than a flag, so that older runners ignore it - CODSPEED_EXPORT_RUN_ID: "true" run: | # Validate required inputs # (custom message for smoother v4 migration)