Skip to content

Commit 246a88c

Browse files
committed
Apply code-review fixes; drop the unworkable @v0 floating tag
/code-review (xhigh) surfaced: - marketplace-major-tag.yml never fires: a GITHUB_TOKEN-published release does not trigger workflows (GitHub anti-recursion), so @v0 never moved. Drop the @v0 floating tag and delete the workflow; recommend commit-SHA (strongest) or immutable release-tag pinning, which need no automation. The release job's publish step is what updates the Marketplace listing, so job: release / credential: GITHUB_TOKEN are now accurate. - action.yml checksum: the `-z "$expected"` guard was dead under set -euo pipefail (the grep | head pipeline tripped pipefail before the empty check), so a missing asset aborted with no diagnostic. Switch to an awk match that exits 0 on no match, also tolerating binary-mode (*) checksums and dropping the SIGPIPE-prone head. - action.yml: multiline-safe GITHUB_OUTPUT write; correct the args comment (the shell also glob-expands, not only whitespace-splits). - action-smoke: assert the version output contains the pinned version rather than only checking it is non-empty. mdsmith check clean, channels.yaml drift-free, zizmor clean. https://claude.ai/code/session_01TKgJTS4UcFPqtdwkxYzTUC
1 parent 6475b6b commit 246a88c

7 files changed

Lines changed: 33 additions & 71 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 and puts `mdsmith` on `PATH`; published to the GitHub Marketplace and referenced as `uses: jeduden/mdsmith@v0`.](../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 and puts `mdsmith` on `PATH`; published to the GitHub Marketplace and pinned by commit SHA or release tag.](../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)

.github/workflows/action-smoke.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,13 @@ jobs:
4040
version: v0.41.0
4141
args: version
4242

43-
- name: Verify mdsmith stayed on PATH and reported a version
43+
- name: Verify mdsmith stayed on PATH and reported the pinned version
4444
shell: bash
4545
env:
4646
GOT_VERSION: ${{ steps.mdsmith.outputs.version }}
4747
run: |
4848
mdsmith version
49-
test -n "$GOT_VERSION"
49+
case "$GOT_VERSION" in
50+
*0.41.0*) echo "version output OK: $GOT_VERSION" ;;
51+
*) echo "::error::unexpected version output: $GOT_VERSION"; exit 1 ;;
52+
esac

.github/workflows/marketplace-major-tag.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

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 and puts `mdsmith` on `PATH`; published to the GitHub Marketplace and referenced as `uses: jeduden/mdsmith@v0`.](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 and puts `mdsmith` on `PATH`; published to the GitHub Marketplace and pinned by commit SHA or release tag.](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 and puts `mdsmith` on `PATH`; published to the GitHub Marketplace and referenced as `uses: jeduden/mdsmith@v0`.](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 and puts `mdsmith` on `PATH`; published to the GitHub Marketplace and pinned by commit SHA or release tag.](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)

action.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ runs:
8282
8383
# Verify the download against the release checksums file. macOS runners
8484
# have shasum but not GNU sha256sum, so fall back to it.
85-
expected="$(grep " ${asset}\$" "${dest}/checksums.txt" | awk '{print $1}' | head -n1)"
85+
# Pull the expected hash for our asset. Match the filename as the last
86+
# field, tolerating the binary-mode "*" prefix, and stop at the first
87+
# match. awk exits 0 even on no match, so the empty check below still
88+
# runs — a grep | head pipeline would trip pipefail + set -e first and
89+
# skip the friendly error.
90+
expected="$(awk -v a="$asset" '{n = $NF; sub(/^\*/, "", n); if (n == a) {print $1; exit}}' "${dest}/checksums.txt")"
8691
if [ -z "$expected" ]; then
8792
echo "::error::${asset} not listed in checksums.txt"
8893
exit 1
@@ -101,13 +106,19 @@ runs:
101106
mv "${dest}/${asset}" "${dest}/${bin}"
102107
chmod +x "${dest}/${bin}"
103108
echo "$dest" >> "$GITHUB_PATH"
104-
echo "version=$("${dest}/${bin}" version)" >> "$GITHUB_OUTPUT"
109+
# Multiline-safe write, in case `mdsmith version` ever prints more
110+
# than the single line it prints today.
111+
{
112+
echo "version<<__MDS_EOF__"
113+
"${dest}/${bin}" version
114+
echo "__MDS_EOF__"
115+
} >> "$GITHUB_OUTPUT"
105116
106117
- if: ${{ inputs.args != '' }}
107118
shell: bash
108119
working-directory: ${{ inputs.working-directory }}
109120
env:
110121
MDSMITH_ARGS: ${{ inputs.args }}
111-
# MDSMITH_ARGS is intentionally unquoted so "check ." splits into
112-
# separate arguments.
122+
# MDSMITH_ARGS is intentionally unquoted so the shell word-splits it
123+
# into separate arguments (and expands any globs), e.g. "check .".
113124
run: mdsmith $MDSMITH_ARGS

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

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ summary: >-
44
A composite action at the repository root downloads the
55
checksum-verified release binary for the runner's OS and
66
architecture and puts `mdsmith` on `PATH`; published to
7-
the GitHub Marketplace and referenced as
8-
`uses: jeduden/mdsmith@v0`.
7+
the GitHub Marketplace and pinned by commit SHA or
8+
release tag.
99
mechanism: push
1010
artifact: cli
11-
command: "uses: jeduden/mdsmith@v0"
11+
command: "uses: jeduden/mdsmith@v0.41.0"
1212
audience: Linting Markdown inside GitHub Actions CI
1313
platforms: [linux, macos, windows]
1414
registry: github.com/marketplace
@@ -56,11 +56,10 @@ one output, `version`, the string `mdsmith version` prints.
5656
Pin `uses:` to a full-length commit SHA for the strongest
5757
guarantee: a SHA can never move. mdsmith publishes
5858
immutable releases, so a release-tag pin like `@v0.41.0`
59-
is a safe, reproducible alternative. Only the floating
60-
`@v0` tag moves by design. GitHub recommends the SHA form,
61-
and this repository uses it for every third-party action.
62-
Keep the version in a trailing comment, as `# v0.41.0`
63-
above.
59+
is a safe, reproducible alternative. GitHub recommends the
60+
SHA form, and this repository uses it for every
61+
third-party action. Keep the version in a trailing
62+
comment, as `# v0.41.0` above.
6463

6564
The action still verifies the downloaded binary's SHA-256
6665
against the release `checksums.txt`. So the action and the
@@ -77,12 +76,9 @@ maintainer accepts the Marketplace Developer Agreement and
7776
enables it on a release. A unique action `name` and
7877
`branding` are required; `action.yml` sets both.
7978

80-
A `marketplace-major-tag` workflow runs on each published
81-
release. It moves the `@v0` major tag onto that release, so
82-
`uses: jeduden/mdsmith@v0` tracks the latest 0.x build. The
83-
first release that ships this `action.yml` makes the listing
84-
and `@v0` resolve. Until then, pin to a commit SHA on
85-
`main`.
79+
The first release that ships this `action.yml` makes the
80+
Marketplace listing and its release tags resolve. Until
81+
then, pin to a commit SHA on `main`.
8682

8783
You can also skip the action entirely. Run the release
8884
binary in a `run:` step. That repeats by hand the download

0 commit comments

Comments
 (0)