From 6358d31fddb606b8d24ef9bb5987cd4ae5e3128e Mon Sep 17 00:00:00 2001 From: Aaron Bockelie Date: Sun, 24 May 2026 17:11:06 -0500 Subject: [PATCH] fix(ci): harden release.yml against shell injection in notes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .github/workflows/release.yml | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 191c01b..f7cd5f3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -79,24 +79,21 @@ jobs: if: steps.check_tag.outputs.exists == 'false' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RELEASE_NAME: ${{ steps.version.outputs.name }} + RELEASE_VERSION: ${{ steps.version.outputs.version }} + # Bind via env to avoid shell interpretation of user-supplied notes + # (backticks, $vars, etc. in the notes must NOT be evaluated). + RELEASE_NOTES_INPUT: ${{ inputs.release_notes }} run: | - NOTES="## ${{ steps.version.outputs.name }} ${{ steps.version.outputs.version }} + 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") - ${{ inputs.release_notes }} - - ### Installation via BRAT - 1. Install the BRAT plugin if you haven't already - 2. Command palette → \"BRAT: Add a beta plugin for testing\" - 3. Enter: \`aaronsb/obsidian-mcp-plugin\` - 4. Enable the plugin in Community Plugins" - - gh release create "${{ steps.version.outputs.version }}" \ - --title "${{ steps.version.outputs.name }} ${{ steps.version.outputs.version }}" \ + gh release create "$RELEASE_VERSION" \ + --title "$RELEASE_NAME $RELEASE_VERSION" \ --generate-notes \ --notes "$NOTES" \ --prerelease \ main.js \ manifest.json \ styles.css \ - "obsidian-mcp-${{ steps.version.outputs.version }}.mcpb" \ + "obsidian-mcp-$RELEASE_VERSION.mcpb" \ obsidian-mcp.mcpb \ No newline at end of file