Skip to content

Commit 9765760

Browse files
committed
Document SHA-pinning as the GitHub Action best practice
Lead the channel doc's usage example and guidance with pinning uses: to a full-length commit SHA rather than a version tag, matching what GitHub recommends and what this repository already does for every third-party action. Clarify the two distinct controls: the SHA pins the action ref, and the action's checksum verification pins the release binary it downloads, so the version: input stays a release tag by design. https://claude.ai/code/session_01TKgJTS4UcFPqtdwkxYzTUC
1 parent 7b6fd5f commit 9765760

4 files changed

Lines changed: 26 additions & 17 deletions

File tree

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ row: "- [{summary}](../{filename})"
5454
- [Rebase, CI monitoring, and review comment resolution.](../docs/development/pr-fixup-workflow.md)
5555
- [The `jeduden/asdf-mdsmith` plugin installs the checksum-verified prebuilt binary; the short form awaits the asdf-plugins registry entry.](../docs/development/release-channels/asdf.md)
5656
- [A single-file `.flatpak` bundle built in CI from the x86_64 Linux release binary and attached to each GitHub release, installed by file with host filesystem access for the linter.](../docs/development/release-channels/flatpak.md)
57-
- [A composite action at the repository root downloads the checksum-verified release binary for the runner's OS and architecture, puts `mdsmith` on `PATH`, and runs the command in its `args` input; referenced as `uses: jeduden/mdsmith@<ref>`.](../docs/development/release-channels/github-actions.md)
57+
- [A composite action at the repository root downloads the checksum-verified release binary for the runner's OS and architecture, puts `mdsmith` on `PATH`, and runs the command in its `args` input; referenced as `uses: jeduden/mdsmith@<commit-sha>`.](../docs/development/release-channels/github-actions.md)
5858
- [Per-platform mdsmith binaries plus the .vsix, the checksum file, and a Sigstore signature, attached to a tag-named release.](../docs/development/release-channels/github-releases.md)
5959
- [`go install` compiles mdsmith from the tagged module source with the host Go 1.25+ toolchain; no prebuilt binary is downloaded.](../docs/development/release-channels/go.md)
6060
- [The `jeduden/homebrew-mdsmith` tap installs the checksum-verified prebuilt binary for macOS or Linux on Intel or arm64.](../docs/development/release-channels/homebrew.md)

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ row: "- [{summary}]({filename})"
6060
- [Rebase, CI monitoring, and review comment resolution.](docs/development/pr-fixup-workflow.md)
6161
- [The `jeduden/asdf-mdsmith` plugin installs the checksum-verified prebuilt binary; the short form awaits the asdf-plugins registry entry.](docs/development/release-channels/asdf.md)
6262
- [A single-file `.flatpak` bundle built in CI from the x86_64 Linux release binary and attached to each GitHub release, installed by file with host filesystem access for the linter.](docs/development/release-channels/flatpak.md)
63-
- [A composite action at the repository root downloads the checksum-verified release binary for the runner's OS and architecture, puts `mdsmith` on `PATH`, and runs the command in its `args` input; referenced as `uses: jeduden/mdsmith@<ref>`.](docs/development/release-channels/github-actions.md)
63+
- [A composite action at the repository root downloads the checksum-verified release binary for the runner's OS and architecture, puts `mdsmith` on `PATH`, and runs the command in its `args` input; referenced as `uses: jeduden/mdsmith@<commit-sha>`.](docs/development/release-channels/github-actions.md)
6464
- [Per-platform mdsmith binaries plus the .vsix, the checksum file, and a Sigstore signature, attached to a tag-named release.](docs/development/release-channels/github-releases.md)
6565
- [`go install` compiles mdsmith from the tagged module source with the host Go 1.25+ toolchain; no prebuilt binary is downloaded.](docs/development/release-channels/go.md)
6666
- [The `jeduden/homebrew-mdsmith` tap installs the checksum-verified prebuilt binary for macOS or Linux on Intel or arm64.](docs/development/release-channels/homebrew.md)

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ row: "- [{summary}]({filename})"
4646
- [Rebase, CI monitoring, and review comment resolution.](docs/development/pr-fixup-workflow.md)
4747
- [The `jeduden/asdf-mdsmith` plugin installs the checksum-verified prebuilt binary; the short form awaits the asdf-plugins registry entry.](docs/development/release-channels/asdf.md)
4848
- [A single-file `.flatpak` bundle built in CI from the x86_64 Linux release binary and attached to each GitHub release, installed by file with host filesystem access for the linter.](docs/development/release-channels/flatpak.md)
49-
- [A composite action at the repository root downloads the checksum-verified release binary for the runner's OS and architecture, puts `mdsmith` on `PATH`, and runs the command in its `args` input; referenced as `uses: jeduden/mdsmith@<ref>`.](docs/development/release-channels/github-actions.md)
49+
- [A composite action at the repository root downloads the checksum-verified release binary for the runner's OS and architecture, puts `mdsmith` on `PATH`, and runs the command in its `args` input; referenced as `uses: jeduden/mdsmith@<commit-sha>`.](docs/development/release-channels/github-actions.md)
5050
- [Per-platform mdsmith binaries plus the .vsix, the checksum file, and a Sigstore signature, attached to a tag-named release.](docs/development/release-channels/github-releases.md)
5151
- [`go install` compiles mdsmith from the tagged module source with the host Go 1.25+ toolchain; no prebuilt binary is downloaded.](docs/development/release-channels/go.md)
5252
- [The `jeduden/homebrew-mdsmith` tap installs the checksum-verified prebuilt binary for macOS or Linux on Intel or arm64.](docs/development/release-channels/homebrew.md)

docs/development/release-channels/github-actions.md

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ summary: >-
55
checksum-verified release binary for the runner's OS and
66
architecture, puts `mdsmith` on `PATH`, and runs the
77
command in its `args` input; referenced as
8-
`uses: jeduden/mdsmith@<ref>`.
8+
`uses: jeduden/mdsmith@<commit-sha>`.
99
mechanism: pull
1010
artifact: cli
1111
command: "uses: jeduden/mdsmith@v0"
@@ -23,10 +23,10 @@ The repository root carries an `action.yml`, so a workflow
2323
step runs mdsmith with:
2424

2525
```yaml
26-
- uses: jeduden/mdsmith@v0
26+
- uses: jeduden/mdsmith@<commit-sha> # v0.41.0
2727
with:
28-
version: latest # a release tag like v0.41.0, or latest
29-
args: check . # omit to only put mdsmith on PATH
28+
version: v0.41.0 # mdsmith release to install, or latest
29+
args: check . # omit to only put mdsmith on PATH
3030
```
3131
3232
The composite action reads `$RUNNER_OS` and
@@ -50,17 +50,26 @@ later step can call it. `working-directory` sets the
5050
directory the `args` command runs in. The action exposes
5151
one output, `version`, the string `mdsmith version` prints.
5252

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.
53+
Pin `uses:` to a full-length commit SHA, not a tag. A SHA
54+
is immutable; a tag like `@v0` can be repointed at new
55+
code. GitHub recommends the SHA form, and this repository
56+
uses it for every third-party action. Keep the version in
57+
a trailing comment, as `# v0.41.0` above.
5658

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.
59+
The action still verifies the downloaded binary's SHA-256
60+
against the release `checksums.txt`. So the action and the
61+
binary it fetches are both pinned by digest, not by a
62+
movable name.
63+
64+
No released commit carries the action yet. Pin to a commit
65+
SHA from this branch, or from `main` once it merges, to use
66+
it today. After the next release, pin to that release's
67+
commit. The convenience tag `@v0` comes later: it must be
68+
created and moved onto a release that ships `action.yml`.
69+
70+
You can also skip the action entirely. Run the release
71+
binary in a `run:` step. That repeats by hand the download
72+
and verify steps the action automates.
6473

6574
Because no published tag installs the action yet, this
6675
channel sets `unlisted: true` in its frontmatter, so

0 commit comments

Comments
 (0)