mirror of
https://github.com/aaronsb/obsidian-mcp-plugin.git
synced 2026-07-22 06:45:14 +00:00
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.
This commit is contained in:
parent
4fddaab955
commit
6358d31fdd
1 changed files with 9 additions and 12 deletions
21
.github/workflows/release.yml
vendored
21
.github/workflows/release.yml
vendored
|
|
@ -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
|
||||
Loading…
Reference in a new issue