|
| 1 | +--- |
| 2 | +title: GitHub Actions |
| 3 | +summary: >- |
| 4 | + A composite action at the repository root downloads the |
| 5 | + checksum-verified release binary for the runner's OS and |
| 6 | + architecture, puts `mdsmith` on `PATH`, and runs the |
| 7 | + command in its `args` input; referenced as |
| 8 | + `uses: jeduden/mdsmith@<ref>`. |
| 9 | +mechanism: pull |
| 10 | +artifact: cli |
| 11 | +command: "uses: jeduden/mdsmith@v0" |
| 12 | +audience: Linting Markdown inside GitHub Actions CI |
| 13 | +platforms: [linux, macos, windows] |
| 14 | +channelurl: https://github.com/jeduden/mdsmith |
| 15 | +weight: 15 |
| 16 | +unlisted: true |
| 17 | +--- |
| 18 | +# GitHub Actions |
| 19 | + |
| 20 | +Release page: <https://github.com/jeduden/mdsmith> |
| 21 | + |
| 22 | +The repository root carries an `action.yml`, so a workflow |
| 23 | +step runs mdsmith with: |
| 24 | + |
| 25 | +```yaml |
| 26 | +- uses: jeduden/mdsmith@v0 |
| 27 | + with: |
| 28 | + version: latest # a release tag like v0.41.0, or latest |
| 29 | + args: check . # omit to only put mdsmith on PATH |
| 30 | +``` |
| 31 | +
|
| 32 | +The composite action reads `$RUNNER_OS` and |
| 33 | +`$RUNNER_ARCH`. It maps them to the matching release |
| 34 | +asset — `mdsmith-linux-amd64`, `mdsmith-darwin-arm64`, |
| 35 | +`mdsmith-windows-amd64.exe`, and the rest. It downloads |
| 36 | +that asset over HTTPS. Then it verifies the SHA-256 |
| 37 | +against the release's `checksums.txt` before it adds the |
| 38 | +binary to `PATH`. |
| 39 | + |
| 40 | +macOS runners fall back to `shasum -a 256`, since they |
| 41 | +ship no GNU `sha256sum`. Windows runners get the one |
| 42 | +`windows-amd64` build. Any other Windows architecture |
| 43 | +fails with a clear error, not a 404. |
| 44 | + |
| 45 | +Three inputs drive it. `version` selects the release — |
| 46 | +`latest` (the default) or a tag such as `v0.41.0`. `args`, |
| 47 | +when non-empty, is split on whitespace and passed to |
| 48 | +`mdsmith`; an empty `args` only installs the binary so a |
| 49 | +later step can call it. `working-directory` sets the |
| 50 | +directory the `args` command runs in. The action exposes |
| 51 | +one output, `version`, the string `mdsmith version` prints. |
| 52 | + |
| 53 | +For a locked-down supply chain, pin `uses:` to a release |
| 54 | +tag or a commit SHA, the way this repository pins every |
| 55 | +third-party action it consumes. |
| 56 | + |
| 57 | +The short `uses: jeduden/mdsmith@v0` form needs two |
| 58 | +things. A tagged release must ship this `action.yml`. The |
| 59 | +floating `v0` tag must then move onto it. Until that |
| 60 | +happens, pin the action to a commit SHA or use `@main`. |
| 61 | +You can also skip the action and run the release binary in |
| 62 | +a `run:` step. That repeats by hand the download and |
| 63 | +verify steps the action automates. |
| 64 | + |
| 65 | +Because no published tag installs the action yet, this |
| 66 | +channel sets `unlisted: true` in its frontmatter, so |
| 67 | +`sync-channels` keeps it out of the website install picker |
| 68 | +and the install-guide table excludes it by glob. The |
| 69 | +`action.yml` and this doc stay; only the user-facing |
| 70 | +listings wait for a release to carry the action. Drop both |
| 71 | +once `uses: jeduden/mdsmith@v0` resolves. |
0 commit comments