Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/GITHUB_ACTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ AETHERXGLOBAL/execsurface@v0.1.0-alpha.5

Do not use `@main` as the normal consumer path.

## Copy-ready consumer example

See [the external consumer workflow](../examples/github-action-consumer.yml) for a complete check-only example. Initialize the workflow once, create and review the baseline explicitly, then commit it for the workflow to check. The workflow never creates, changes, or approves a baseline.

## Minimal workflow

```yaml
Expand Down
59 changes: 59 additions & 0 deletions examples/github-action-consumer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Copy this file to .github/workflows/execsurface.yml in a consumer repository.
# One-time setup: execsurface init --command "git diff --check" --github-actions
# Create a baseline explicitly with:
# execsurface learn --output execsurface.lock.json -- /bin/bash -lc "git diff --check"
# Review and commit the baseline deliberately; this workflow only checks it.
# Stable public-alpha channel: @v0.1
# Immutable Alpha.5 review pin: replace @v0.1 with @v0.1.0-alpha.5.
# Full behavior and limitations: ../docs/GITHUB_ACTION.md

name: ExecSurface
on:
pull_request:

permissions:
contents: read

jobs:
execsurface:
runs-on: ubuntu-24.04
steps:
- name: Check out the consumer repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Check the explicitly reviewed baseline
id: execsurface
uses: AETHERXGLOBAL/execsurface@v0.1
with:
command: "git diff --check"
baseline: execsurface.lock.json
fail-on-review: "true"
upload-artifact: "false"

- name: Report the ExecSurface verdict
if: always()
shell: bash
env:
VERDICT: ${{ steps.execsurface.outputs.verdict }}
EXIT_CODE: ${{ steps.execsurface.outputs.exit-code }}
run: |
case "$VERDICT" in
pass)
echo "ExecSurface: PASS"
;;
review)
echo "::warning::ExecSurface: REVIEW (fail-on-review is enabled; exit $EXIT_CODE)"
;;
block)
echo "::error::ExecSurface: BLOCK (exit $EXIT_CODE)"
exit 20
;;
error)
echo "::error::ExecSurface: ERROR (exit $EXIT_CODE)"
exit 2
;;
*)
echo "::error::ExecSurface returned an unknown verdict"
exit 2
;;
esac