From 51f8140acb4fb220e9f0c1a94081c3fce0a3ce9e Mon Sep 17 00:00:00 2001 From: Walt Moorhouse Date: Wed, 2 Jun 2021 13:02:50 -0700 Subject: [PATCH] fixed wrong condition in if statement --- .github/workflows/on-merge.yml | 32 -------------------------------- .github/workflows/release.yml | 10 +++++++--- README.md | 2 +- action.yml | 4 ++-- 4 files changed, 10 insertions(+), 38 deletions(-) delete mode 100644 .github/workflows/on-merge.yml diff --git a/.github/workflows/on-merge.yml b/.github/workflows/on-merge.yml deleted file mode 100644 index 720362c..0000000 --- a/.github/workflows/on-merge.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: On PR Merge - -on: - workflow_dispatch: - pull_request: - types: [closed] - branches: [main] - -jobs: - Update-Changelog: - if: ${{ github.event.pull_request.merged }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - uses: KrogerWalt/action-get-latest-tag@v2 - id: get-latest-tag - - - uses: KrogerWalt/action-update-changelog@main - id: changelog-update - with: - branch_name: ${{ github.event.pull_request.head.ref }} - ticket_url_prefix: https://github.com/${{ github.repository }}/issues/ - version: ${{ steps.get-latest-tag.outputs.tag }} - - - name: Commit Changelog - run: | - git config --global --replace-all user.name "$GITHUB_ACTOR" - git config --global --replace-all user.email "$GITHUB_ACTOR@users.noreply.github.com" - git add CHANGELOG.md - git commit -m "Updating Changelog" - git push origin main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c52e14..2bb9246 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,13 +33,17 @@ jobs: - uses: KrogerWalt/action-update-changelog@main id: changelog-update - if: ${{ github.event.pull_request.merged == true }} with: ticket_url_prefix: https://github.com/${{ github.repository }}/issues/ version: ${{ steps.bump-semver.outputs.new_version }} - - name: print-changelog - run: cat CHANGELOG.md + - name: Commit Changelog + run: | + git config --global --replace-all user.name "$GITHUB_ACTOR" + git config --global --replace-all user.email "$GITHUB_ACTOR@users.noreply.github.com" + git add CHANGELOG.md + git commit -m "Updating Changelog" + git push origin main - uses: actions-ecosystem/action-regex-match@v2 id: regex-match diff --git a/README.md b/README.md index a23736d..0d83ff9 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ will update the changelog to have a new entry like: | `branch_name` | Overrides the branch name to parse for the message. Default is name of current branch. | `string` | `false` | `current branch` | | `changelog_file` | Overrides the path to the changelog. Default is ./CHANGELOG.md | `string` | `false` | CHANGELOG.md | | `ticket_url_prefix` | If provided, will be used to create a link for referenced issues. (Make sure to include ending slash if needed. This allows ticket to be param as well.) | `string` | `false` | `N/A` | -| `version` | The version of the release will be added above this and the other unreleased changes. If not supplied this change will be added to unreleased changes. | `string` | `false` | `N/A` | +| `version` | The version of the release will be added above this change. | `string` | `true` | `N/A` | ## Outputs diff --git a/action.yml b/action.yml index f7e9115..891d508 100644 --- a/action.yml +++ b/action.yml @@ -13,8 +13,8 @@ inputs: description: If provided, will be used to create a link for referenced issues. required: false version: - description: The version of the release will be added above this and the other unreleased changes. If not supplied this change will be added to unreleased changes. - required: false + description: The version of the release will be added above this change. + required: true outputs: change_md: description: The Markdown that was generated for this change.