@@ -308,6 +308,46 @@ the full walk-through including the `sway.yaml` template, the |
| 308 | consumer-side `.pre-commit-config.yaml`, and the | 308 | consumer-side `.pre-commit-config.yaml`, and the |
| 309 | try-it-locally-before-you-install recipe. | 309 | try-it-locally-before-you-install recipe. |
| 310 | | 310 | |
| | 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 | + |
| 311 | ## The `.dlm` integration | 351 | ## The `.dlm` integration |
| 312 | | 352 | |
| 313 | If you trained your adapter via the [DocumentLanguageModel | 353 | If you trained your adapter via the [DocumentLanguageModel |