tenseleyflow/sway / ea13903

Browse files

README: add GitHub Action section with copy-paste one-liner + complete workflow

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
ea139035f97ac038700ffdff8eb7a096452dfadf
Parents
814522d
Tree
6931651

1 changed file

StatusFile+-
M README.md 40 0
README.mdmodified
@@ -308,6 +308,46 @@ the full walk-through including the `sway.yaml` template, the
308308
 consumer-side `.pre-commit-config.yaml`, and the
309309
 try-it-locally-before-you-install recipe.
310310
 
311
+## GitHub Action
312
+
313
+For repos that don't use pre-commit, the
314
+[`tenseleyflow/sway-action`](https://github.com/tenseleyFlow/sway-action)
315
+GitHub Action wraps `sway gate` + a markdown report posted as a PR
316
+comment in three lines of YAML:
317
+
318
+```yaml
319
+- uses: tenseleyflow/sway-action@v0.1.0
320
+  with:
321
+    spec-path: sway.yaml
322
+```
323
+
324
+The action handles install, caching, gate execution, edit-in-place
325
+PR comments (so rebases don't spam), and exit-code translation. A
326
+complete workflow:
327
+
328
+```yaml
329
+name: sway
330
+on:
331
+  pull_request:
332
+    paths: ["**/*.dlm", "**/sway.yaml"]
333
+permissions:
334
+  contents: read
335
+  pull-requests: write
336
+jobs:
337
+  sway:
338
+    runs-on: ubuntu-latest
339
+    steps:
340
+      - uses: actions/checkout@v4
341
+      - uses: tenseleyflow/sway-action@v0.1.0
342
+        with:
343
+          spec-path: sway.yaml
344
+```
345
+
346
+Inputs include `fail-on` (`fail` / `warn` / `never`),
347
+`comment-on-pr`, `upload-artifact`, and `sway-version` for pinning.
348
+Outputs `sway-score`, `verdict`, and `report-path` are available to
349
+downstream steps. See the action repo's README for the full surface.
350
+
311351
 ## The `.dlm` integration
312352
 
313353
 If you trained your adapter via the [DocumentLanguageModel