From 066f93b83e3266e37bca08990cbd0c2ed444245e Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Wed, 18 Nov 2026 06:07:32 +0700 Subject: [PATCH] fix(action): count observe runs as the GitHub Action surface The Observe step now sets DIFFCI_SURFACE=github-action, so usage events from the Action's default path are recorded as github-action rather than cli. The opt-in verify script already exported this, as do the GitLab and Azure wrappers. Fixes #284 Signed-off-by: FredApps <153173854+FredApps@users.noreply.github.com> --- action.yml | 1 + tests/action-metadata.test.ts | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/action.yml b/action.yml index fc6b1ba3..6ecc2e7a 100644 --- a/action.yml +++ b/action.yml @@ -189,6 +189,7 @@ runs: DIFFCI_API_URL: ${{ inputs.api-url }} DIFFCI_TOKEN: ${{ inputs.api-token }} DIFFCI_CLI_VERSION: ${{ inputs.cli-version }} + DIFFCI_SURFACE: github-action run: | set -euo pipefail if [[ ! "$DIFFCI_CLI_VERSION" =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$ ]]; then diff --git a/tests/action-metadata.test.ts b/tests/action-metadata.test.ts index 8ca0dcf5..75466245 100644 --- a/tests/action-metadata.test.ts +++ b/tests/action-metadata.test.ts @@ -104,6 +104,13 @@ test("public observer Action uses only composite-action contexts and safe descri } }); +test("public observer Action counts observe runs as the GitHub Action surface", async () => { + const { action } = await readAction(); + const observe = action.runs.steps.find((step) => step.id === "observe"); + assert.ok(observe, "observe step is present"); + assert.equal(observe.env?.DIFFCI_SURFACE, "github-action"); +}); + test("public observer Action passes its token only through the environment", async () => { const { action } = await readAction(); const observe = action.runs.steps.find((step) => step.id === "observe");