Skip to content

Commit 6358d31

Browse files
committed
fix(ci): harden release.yml against shell injection in notes
The previous template inlined ${{ inputs.release_notes }} directly into a double-quoted bash NOTES="..." assignment, so backticks (or $vars) in the notes were evaluated by the shell as command substitution. Today's 0.11.30 release hit this — backticks in the ADR-107 release notes blew up the heredoc and failed the workflow before tag creation. Switch the templated values to env-var bindings (RELEASE_NAME, RELEASE_VERSION, RELEASE_NOTES_INPUT) and assemble the markdown via printf so the notes are treated as data, not code.
1 parent 4fddaab commit 6358d31

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,24 +79,21 @@ jobs:
7979
if: steps.check_tag.outputs.exists == 'false'
8080
env:
8181
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
RELEASE_NAME: ${{ steps.version.outputs.name }}
83+
RELEASE_VERSION: ${{ steps.version.outputs.version }}
84+
# Bind via env to avoid shell interpretation of user-supplied notes
85+
# (backticks, $vars, etc. in the notes must NOT be evaluated).
86+
RELEASE_NOTES_INPUT: ${{ inputs.release_notes }}
8287
run: |
83-
NOTES="## ${{ steps.version.outputs.name }} ${{ steps.version.outputs.version }}
88+
NOTES=$(printf '## %s %s\n\n%s\n\n### Installation via BRAT\n1. Install the BRAT plugin if you haven'\''t already\n2. Command palette → "BRAT: Add a beta plugin for testing"\n3. Enter: `aaronsb/obsidian-mcp-plugin`\n4. Enable the plugin in Community Plugins\n' "$RELEASE_NAME" "$RELEASE_VERSION" "$RELEASE_NOTES_INPUT")
8489
85-
${{ inputs.release_notes }}
86-
87-
### Installation via BRAT
88-
1. Install the BRAT plugin if you haven't already
89-
2. Command palette → \"BRAT: Add a beta plugin for testing\"
90-
3. Enter: \`aaronsb/obsidian-mcp-plugin\`
91-
4. Enable the plugin in Community Plugins"
92-
93-
gh release create "${{ steps.version.outputs.version }}" \
94-
--title "${{ steps.version.outputs.name }} ${{ steps.version.outputs.version }}" \
90+
gh release create "$RELEASE_VERSION" \
91+
--title "$RELEASE_NAME $RELEASE_VERSION" \
9592
--generate-notes \
9693
--notes "$NOTES" \
9794
--prerelease \
9895
main.js \
9996
manifest.json \
10097
styles.css \
101-
"obsidian-mcp-${{ steps.version.outputs.version }}.mcpb" \
98+
"obsidian-mcp-$RELEASE_VERSION.mcpb" \
10299
obsidian-mcp.mcpb

0 commit comments

Comments
 (0)