Skip to content

Some chars need to be escaped #349

@Goooler

Description

@Goooler

My changelog looks like this:

### Added
* In order to use `custom`, you must now use Gradle 8.0+.

I use this action to pick it and release it like:

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - name: Extract release notes
        id: extract-release-notes
        uses: ffurrer2/extract-release-notes@v2
      - name: Create release
        run: gh release create --title ${{ github.ref_name }} --notes '${{ steps.extract-release-notes.outputs.release_notes }}'
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

and the errors will show:

/home/runner/work/_temp/b424905f-a1d2-4aef-ba90-8f409d60cac5.sh: line 2: custom: command not found

in this case, I tried to write the output into a file and pick the file from GH CLI like:

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - name: Extract release notes
        id: extract-release-notes
        uses: ffurrer2/extract-release-notes@v2
      - name: Write release note into a file
        run: echo "${{ steps.extract-release-notes.outputs.release_notes }}" > release_notes.txt
      - name: Create release
        run: gh release create --title ${{ github.ref_name }} --notes-file release_notes.txt
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

The same error shown. I believe we have to escape "`" in my example and write it to a file:

echo "### Added\n* In order to use \`custom\`, you must now use Gradle 8.0+.\n" > note.txt

cat note.txt

### Added
* In order to use `custom`, you must now use Gradle 8.0+.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions