mikepenz / release-changelog-builder-action

A GitHub action that builds your release notes / changelog fast, easy and exactly the way you want.
https://blog.mikepenz.dev
Apache License 2.0
716 stars 103 forks source link

commitMode does not work anymore #1356

Closed KonradHoeffner closed 3 months ago

KonradHoeffner commented 3 months ago

Since upgrading this action from v4 to v5, commitMode does not work anymore.

Excerpt from our .github/workflows/release.yml:

    steps:
      - name: Build Changelog
        id: build-changelog
        uses: mikepenz/release-changelog-builder-action@v5
        with:
          commitMode: true
          configurationJson: |
            {
              "pr_template": "- #{{TITLE}}",
              "template": "#{{UNCATEGORIZED}}"
            }

This used to generate one bullet point for each commit but since the upgrade to v5 it only generates one for each PR. Seeing https://github.com/mikepenz/release-changelog-builder-action/commit/db235a662798f2136557b8fea6232de1f3e81379, it seems like this got changed but not updated in README.md?

src/main.ts looks like commitMode should be picked up but it is not recognized:

Run mikepenz/release-changelog-builder-action@v5
  with:
    commitMode: true
    configurationJson: {
    "pr_template": "- #{{TITLE}}",
    "template": "#{{UNCATEGORIZED}}"
  }

    includeOpen: false
    ignorePreReleases: false
    failOnError: false
    fetchViaCommits: false
    fetchReviewers: false
    fetchReleaseInformation: false
    fetchReviews: false
    token: ***
    exportCache: false
    exportOnly: false
    platform: github
  env:
    NAME: rickview
    CARGO_TERM_COLOR: always
    CARGO_INCREMENTAL: 0
    RUSTFLAGS: -Dwarnings
📘 Reading input values
  ℹ️ Retrieved configuration via 'configurationJson'.
  ℹ️ Running in PR mode.
🔖 Resolve tags
  ℹ️ Found 34 (fetching max: 200) tags from the GitHub API for KonradHoeffner/rickview
  🔖 Resolved current tag (0.3.4) from the 'github.context.ref'
  🔖 Resolved previous tag (0.3.3) from the tags git API
🚀 Load data
  🚀 Load pull requests
  ℹ️ Comparing KonradHoeffner/rickview - '0.3.3...0.3.4'
  ℹ️ Found 4 commits from the GitHub API for KonradHoeffner/rickview
  ℹ️ Fetching PRs between dates 2024-07-15T13:54:11.000Z to 2024-08-05T13:37:17.000Z for KonradHoeffner/rickview
  ℹ️ Retrieved 4 release commits for KonradHoeffner/rickview
  ℹ️ Retrieved 10 PRs for KonradHoeffner/rickview in date range from API
  ℹ️ Retrieved 1 merged PRs for KonradHoeffner/rickview
📦 Build changelog
  ℹ️ Sorted all pull requests ascending: {"order":"ASC","on_property":"mergedAt"}
  ℹ️ Used 0 transformers to adjust message
  ✒️ Wrote messages for 1 pull requests
  ℹ️ Ordered all pull requests into 4 categories
  ✒️ Wrote 0 categorized pull requests down
  ✒️ Wrote 1 non categorized pull requests down
  ✒️ Wrote 0 ignored pull requests down
  ℹ️ Filled template
KonradHoeffner commented 3 months ago

Could this line from src/main.ts be the culprit?

const mode = resolveMode(core.getInput('mode'), core.getInput('commitMode') === 'true')

It seems as if commitMode is compared to the string 'true' but as per documentation the boolean value true is given and then compared with the === operator. Or does the yaml library compare booleans to strings?

mikepenz commented 3 months ago

Commit mode is deprecated and I'd advice to transition to the mode setting: https://github.com/mikepenz/release-changelog-builder-action/blob/develop/action.yml#L45-L47

This was actually a bug and got fixed by: https://github.com/mikepenz/release-changelog-builder-action/pull/1351

Will move forward tagging a new release. apologies

mikepenz commented 3 months ago

v5 / v5.0.0-rc02 was released. This should work again as expected

KonradHoeffner commented 3 months ago

Thank you for the swift release and reply, I switched to mode: "COMMIT" and it works perfectly!