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");