Skip to content

Commit 2e569a2

Browse files
committed
Second code-review pass: heredoc-on-failure and doc version coherence
- action.yml: capture `mdsmith version` into a variable before the GITHUB_OUTPUT heredoc. A non-zero version exit now aborts cleanly (set -e) instead of leaving a dangling, unterminated `version<<EOF` that corrupts GITHUB_OUTPUT with "Matching delimiter not found". - github-actions.md: stop presenting the concrete v0.41.0 as the action ref (that release predates action.yml). Use a vX.Y.Z placeholder, decouple the binary `version:` input (default latest) from the pinned action ref, and note to set `command` to the first action-bearing release tag at go-live. https://claude.ai/code/session_01TKgJTS4UcFPqtdwkxYzTUC
1 parent 246a88c commit 2e569a2

2 files changed

Lines changed: 17 additions & 13 deletions

File tree

action.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,14 @@ runs:
106106
mv "${dest}/${asset}" "${dest}/${bin}"
107107
chmod +x "${dest}/${bin}"
108108
echo "$dest" >> "$GITHUB_PATH"
109-
# Multiline-safe write, in case `mdsmith version` ever prints more
110-
# than the single line it prints today.
109+
# Capture first so a non-zero `mdsmith version` aborts here (set -e)
110+
# rather than leaving a half-written heredoc in GITHUB_OUTPUT. The
111+
# heredoc keeps the write correct even if version output ever grows
112+
# past the single line it prints today.
113+
ver="$("${dest}/${bin}" version)"
111114
{
112115
echo "version<<__MDS_EOF__"
113-
"${dest}/${bin}" version
116+
echo "$ver"
114117
echo "__MDS_EOF__"
115118
} >> "$GITHUB_OUTPUT"
116119

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ summary: >-
88
release tag.
99
mechanism: push
1010
artifact: cli
11-
command: "uses: jeduden/mdsmith@v0.41.0"
11+
command: "uses: jeduden/mdsmith@vX.Y.Z"
1212
audience: Linting Markdown inside GitHub Actions CI
1313
platforms: [linux, macos, windows]
1414
registry: github.com/marketplace
@@ -26,9 +26,9 @@ The repository root carries an `action.yml`, so a workflow
2626
step runs mdsmith with:
2727

2828
```yaml
29-
- uses: jeduden/mdsmith@<commit-sha> # v0.41.0
29+
- uses: jeduden/mdsmith@<commit-sha> # vX.Y.Z
3030
with:
31-
version: v0.41.0 # mdsmith release to install, or latest
31+
version: latest # which mdsmith release to install (a tag, or latest)
3232
args: check . # omit to only put mdsmith on PATH
3333
```
3434
@@ -55,11 +55,12 @@ one output, `version`, the string `mdsmith version` prints.
5555

5656
Pin `uses:` to a full-length commit SHA for the strongest
5757
guarantee: a SHA can never move. mdsmith publishes
58-
immutable releases, so a release-tag pin like `@v0.41.0`
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.
58+
immutable releases, so a release-tag pin like `@vX.Y.Z`
59+
(any release that ships `action.yml`) is a safe,
60+
reproducible alternative. 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 `# vX.Y.Z`
63+
above.
6364

6465
The action still verifies the downloaded binary's SHA-256
6566
against the release `checksums.txt`. So the action and the
@@ -88,5 +89,5 @@ While the listing is pending, the channel stays hidden. It
8889
sets `unlisted: true`. `sync-channels` then keeps it out of
8990
the install picker and the "Available on" strip. The
9091
install-guide and release-pipeline tables exclude it by
91-
glob. Flip `unlisted` and drop both glob exclusions once the
92-
listing resolves.
92+
glob. Once the listing resolves, flip `unlisted`, drop both
93+
glob exclusions, and set `command` to that release's tag.

0 commit comments

Comments
 (0)