From ef5a45fac424e855a1cd5782d071053e3af7080b Mon Sep 17 00:00:00 2001 From: Michael van Tellingen Date: Sat, 22 Apr 2023 12:11:35 +0200 Subject: [PATCH] Improve PR body text Make the workflow text optional if there is a rlease workfow defined --- .github/workflows/release.yaml | 2 ++ README.md | 16 +++++++++++----- action.yaml | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 61154da..79243c6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -25,4 +25,6 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} release-workflow: '' + version-command: | + sed -r -i '' 's#(labd/changie-release-action@)([^[:space:]]+)#\1'"${PACKAGE_VERSION}"'#' README.md diff --git a/README.md b/README.md index ef63a6d..075dc3f 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ # changie-release-action Automate version and release management using [changie](https://github.com/miniscruff/changie) -This action creates a new PR with an updated `CHANGELOG.md` file. When merged it will automatically -create a new tag and trigger another GitHub action workflow that can then do the actual release. +This action creates a new PR with an updated `CHANGELOG.md` file. When merged it +will automatically create a new tag and trigger another GitHub action workflow +that can then do the actual release. -The workflow is inspired both by [changie](https://github.com/miniscruff/changie) and [@changesets/action](https://github.com/changesets/action) +The workflow is inspired both by [changie](https://github.com/miniscruff/changie) +and [@changesets/action](https://github.com/changesets/action) ## Usage @@ -34,11 +36,15 @@ jobs: uses: labd/changie-release-action@v0.2.0 with: github-token: ${{ secrets.GITHUB_TOKEN }} - + + # Optionally run a command with the new version number when the new + # version is determined. + version-command: 'echo "New version is $PACKAGE_VERSION" > version.txt' + # Trigger another release workflow to do the actual release. # Set to for example `release.yaml` to trigger that workflow. # Default is no trigger - release-workflow: 'release.yaml' + release-workflow: 'release.yaml' ``` ## Triggering a release diff --git a/action.yaml b/action.yaml index 7ebf4d2..4f0f8c1 100644 --- a/action.yaml +++ b/action.yaml @@ -98,7 +98,7 @@ runs: commit-message: Release ${{ steps.latest.outputs.output }} token: ${{ inputs.github-token }} body: | - This PR was created by the [Changie release GitHub action](https://github.com/labd/changie-release-action). When you're ready to do a release, you can merge this and the tag ${{ steps.latest.outputs.output}} will be created and the release workflow will be started. If you're not ready to do a release yet, that's fine, whenever you add more changes to main, this PR will be updated. + This PR was created by the [Changie release GitHub action](https://github.com/labd/changie-release-action). When you're ready to do a release, you can merge this and the tag ${{ steps.latest.outputs.output }} will be created${{ inputs.release-workflow != '' && format(' and the {0} workflow will be started', inputs.release-workflow) || '' }}. If you're not ready to do a release yet, that's fine, whenever you add more changes to main, this PR will be updated. # Releases ${{ steps.changelog.outputs.output }}