Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exporting changelog entry to tmp file #68

Open
jon-whit opened this issue Jul 27, 2022 · 3 comments
Open

exporting changelog entry to tmp file #68

jon-whit opened this issue Jul 27, 2022 · 3 comments
Labels
type: enhancement New feature or request

Comments

@jon-whit
Copy link

jon-whit commented Jul 27, 2022

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 }}
@mindsers mindsers added the type: enhancement New feature or request label Aug 9, 2022
@mindsers
Copy link
Owner

mindsers commented Aug 9, 2022

Hi! Thanks for submitting this issue! ❤️

This is definitely an interesting idea. I think it'll make changelog-reader even more useful.
And I really appreciate that you offer to contribute.

I'm wondering if other data (other than the entry's content) could be useful as a temporary file also?

@mindsers
Copy link
Owner

mindsers commented Aug 9, 2022

@all-contributors Let's add @jon-whit for ideas.

@allcontributors
Copy link
Contributor

@mindsers

I've put up a pull request to add @jon-whit! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants