release-changelog-builder-action icon indicating copy to clipboard operation
release-changelog-builder-action copied to clipboard

No Information in release

Open buckmaxwell opened this issue 1 year ago โ€ข 4 comments

Hi - thrilled to use this. Seems like it should fit our use case perfectly. Though the pipeline runs - and indeed creates a tag, there is no information in the release. Any idea what I am doing wrong? I will include my github actions pipleline code. Thanks again for this project!

Screen Shot 2022-08-09 at 10 25 14 AM Screen Shot 2022-08-09 at 10 26 08 AM
name: 'Generate Changelog'

on:
  push:
    tags:
      - 'w*'

jobs:
  release:
    if: startsWith(github.ref, 'refs/tags/')
    runs-on: ubuntu-latest
    steps:
      - name: Build Changelog
        id: github_release
        uses: mikepenz/release-changelog-builder-action@v3
        with:
          configuration: "changelog-builder.json"
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Create Release
        uses: mikepenz/[email protected] #softprops/action-gh-release
        with:
          body: ${{steps.github_release.outputs.changelog}}

buckmaxwell avatar Aug 09 '22 14:08 buckmaxwell

Thank you for the report @buckmaxwell

the log indicates that there were 51 pull requests matched for this release. But none of these were categorized.

The categorization works based on PR labels.

By default it looks for the following labels: https://github.com/mikepenz/release-changelog-builder-action/blob/develop/src/configuration.ts#L80-L93

Make sure the PRs have such labels assigned, and then they will be categorized.

In case you want to adjust the template to also include non categorized PRs. (by default they are not included: https://github.com/mikepenz/release-changelog-builder-action/blob/develop/src/configuration.ts#L77) - You may want to use a template like:

"template": "${{CHANGELOG}}\n\n<details>\n<summary>Uncategorized</summary>\n\n${{UNCATEGORIZED}}\n</details>",

(as part of a full example: https://github.com/mikepenz/release-changelog-builder-action/blob/develop/configs/configuration_complex.json)

mikepenz avatar Aug 09 '22 15:08 mikepenz

Thank you so much for your quick reply. I tried changing to a setup that looks like this but I am still having no information included in the release log.

Maybe worth mentioning - my tag is on a different branch from master.

name: 'Generate Changelog'

on:
  push:
    tags:
      - 'w*'

jobs:
  release:
    if: startsWith(github.ref, 'refs/tags/')
    runs-on: ubuntu-latest
    steps:
      - name: Build Changelog
        id: github_release
        uses: mikepenz/release-changelog-builder-action@v3
        with:
          configuration: "changelog-builder.json"
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Create Release
        uses: mikepenz/[email protected] #softprops/action-gh-release
        with:
          body: ${{steps.github_release.outputs.changelog}}

The changelog-builder.json looks like this,

{
  "categories": [
    {
      "title": "## ๐Ÿš€ Features",
      "labels": [
        "feature"
      ]
    },
    {
      "title": "## ๐Ÿ› Fixes",
      "labels": [
        "fix"
      ]
    },
    {
      "title": "## ๐Ÿงช Tests",
      "labels": [
        "test"
      ]
    }
  ],
  "sort": "ASC",
  "template": "${{CHANGELOG}}\n\n<details>\n<summary>Uncategorized</summary>\n\n${{UNCATEGORIZED}}\n</details>",
  "pr_template": "- ${{TITLE}}\n   - PR: #${{NUMBER}}",
  "empty_template": "- no changes",
  "transformers": [
    {
      "pattern": "[\\-\\*] (\\[(...|TEST|CI|SKIP)\\])( )?(.+?)\n(.+?[\\-\\*] )(.+)",
      "target": "- $4\n  - $6"
    }
  ],
  "max_tags_to_fetch": 200,
  "max_pull_requests": 20,
  "max_back_track_time_days": 90
}

buckmaxwell avatar Aug 09 '22 17:08 buckmaxwell

@buckmaxwell the different branch aspect is ok.

Given the original log. It did detect the branches.

In the shared code I see that you are using the action in it's own job. But you don't use a checkout action before. Given that the configuration json is part of your git only you'd have to either checkout the files, or provide the config you want to use as json within the yaml.

For example: https://github.com/mikepenz/release-changelog-builder-action/blob/develop/.github/workflows/ci.yml#L42-L74


The linked configuration was an example for a different template and did include various configs which probably won't be needed for your case, and are optional. (you won't actually need the transformers if you are happy with the original format for example)

mikepenz avatar Aug 09 '22 18:08 mikepenz

Good day. Were you able to resolve this?

mikepenz avatar Aug 12 '22 07:08 mikepenz