From 8659b7fa06f00c2f0082b24bbb5cd5fac3bfd7d4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 12:17:26 +0000 Subject: [PATCH 1/3] Initial plan From 0959785e51eef12e3e67bd940c1c50725c4cf5f5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 12:19:17 +0000 Subject: [PATCH 2/3] docs: add conditional collection with debug mode example to README Co-authored-by: Garbee <868301+Garbee@users.noreply.github.com> --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/README.md b/README.md index 346b16c..9aa5d18 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,52 @@ The action will automatically: - Display metrics with timestamps in clear tables - Generate alerts for threshold violations +### Conditional Collection with Debug Mode + +For teams that want metric collection available but not always running, you can conditionally enable the action using the `runner.debug` context. This allows you to leave the action in your workflow without incurring the performance overhead on every run. + +```yaml +name: Example Workflow + +on: [push] + +jobs: + example: + runs-on: ubuntu-latest + steps: + # Only collect metrics when debug mode is enabled + - name: Start Workflow Telemetry + if: ${{ runner.debug == '1' }} + uses: garbee/runner-resource-usage@v1 + + # Regular workflow steps + - name: Checkout + uses: actions/checkout@v6 + + - name: Run tests + run: npm test + + # ... other steps +``` + +**Enabling debug mode:** + +When you need to collect metrics, enable debug mode by: + +1. Go to your failed or completed workflow run +2. Click "Re-run jobs" in the top-right corner +3. Check the "Enable debug logging" checkbox +4. Click "Re-run jobs" + +This approach provides several benefits: + +- **No re-instrumentation needed**: The action stays in your workflow, ready to use when needed +- **Performance optimization**: Metrics collection only runs when you need it, avoiding overhead on regular runs +- **On-demand debugging**: Enable collection instantly when investigating slow builds or resource issues +- **Team flexibility**: Any team member can enable metrics collection without modifying the workflow file + +The `runner.debug` context is documented in the [GitHub Actions contexts reference](https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#runner-context). + ### Configuration Options | Input | Description | Required | Default | From d98d3e3e4f950a2c26f3a5dc376d0f715023aed7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 12:19:57 +0000 Subject: [PATCH 3/3] docs: fix GitHub Actions contexts reference URL Co-authored-by: Garbee <868301+Garbee@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9aa5d18..5a3ee1e 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,7 @@ This approach provides several benefits: - **On-demand debugging**: Enable collection instantly when investigating slow builds or resource issues - **Team flexibility**: Any team member can enable metrics collection without modifying the workflow file -The `runner.debug` context is documented in the [GitHub Actions contexts reference](https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#runner-context). +The `runner.debug` context is documented in the [GitHub Actions contexts reference](https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context). ### Configuration Options