Skip to content

exporting changelog entry to tmp file #68

@jon-whit

Description

@jon-whit

Would you be open to a contribution that allows changelog-reader-action to export a tmp file path that contains the changelog entry? This would be helpful to avoid shell escape sequence on richer markdown content. I've ran into issues with this for integrations that require a path to a file containing release notes (like goreleaser for example). I'd be happy to contribute this feature if you'd be open to it 👍

I was thinking:
outputs.changesFile - a path to a temporary file containing the text for the changelog entry.

Then I can use it like so:

name: release

on:
  push:
    tags:
      - 'v*'

jobs:
  goreleaser:
    runs-on: ubuntu-latest
    steps:
      - name: Extract Version from Tag
        id: tag_name
        run: |
          echo ::set-output name=current_version::${GITHUB_REF#refs/tags/v}
        shell: bash

      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - name: Generate Release Changes
        id: changelog_reader
        uses: mindsers/changelog-reader-action@v2
        with:
          version: ${{ steps.tag_name.outputs.current_version }}

      - name: Set up Go
        uses: actions/setup-go@v2
        with:
          go-version: 1.18

      - name: Login to Docker Hub
        uses: docker/login-action@v2
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}

      - name: Run GoReleaser
        uses: goreleaser/goreleaser-action@v2
        with:
          distribution: goreleaser
          version: latest
          args: release --rm-dist --release-notes ${{ steps.changelog_reader.outputs.changesFile }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions