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

[Question] Changelog Generation when Doing "Squash and Merge" #1405

Open
khaled-cr opened this issue Dec 9, 2024 · 3 comments
Open

[Question] Changelog Generation when Doing "Squash and Merge" #1405

khaled-cr opened this issue Dec 9, 2024 · 3 comments

Comments

@khaled-cr
Copy link

khaled-cr commented Dec 9, 2024

Hi Mike,

I started using this action recently to generate changelogs when code is merged to main branch as part of PR for production release.
It works well when I do Merge or Rebase and Merge but doesn't publish desired changelog when doing Squash and Merge.

My step for this:

      - name: Build Changelog
        uses: mikepenz/release-changelog-builder-action@v5
        id: github_release
        with:
          mode: "HYBRID"
          fetchViaCommits: true
          fromTag: "${{ github.event.pull_request.head.ref }}"
          toTag: "${{ inputs.IMAGE_TAG }}"   --> this resolves to something like v1.8.0
          configurationJson: |
            {
              "template": "#{{CHANGELOG}}",
              "categories": [
                {
                    "title": "## 🌟 Added",
                    "labels": ["added"]
                },
                {
                    "title": "## 🛠 Changed",
                    "labels": ["changed"]
                },
                {
                    "title": "## 🐛 Fixed",
                    "labels": ["fixed"]
                },
                {
                    "title": "## ♻️ Deprecated",
                    "labels": ["deprecated"]
                },
                {
                    "title": "## ✂️ Removed",
                    "labels": ["removed"]
                },
                {
                    "title": "## 🔒 Security",
                    "labels": ["security"]
                },
                {
                    "title": "## 💬 Other",
                    "labels": []
                }
              ],
              "label_extractor": [
                {
                  "pattern": "^(added|changed|fixed|removed|deprecated|security){1}(\\([\\w\\-\\.]+\\))?(!)?: ([\\w ])+([\\s\\S]*)",
                  "target": "$1"
                }
              ]
            }
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_ACTIONS_TOKEN }}

When I choose to Merge or Rebase and Merge, I get expected changelog of all commits under their respective categories.
When I choose to Squash and Merge, I get changelog generated like this:

💬 Other
Cl test4
   PR: [104]
Cl test4 
    PR: #0

Cl test4 is the PR title not commit comment of any of the items underneath it.
I also noticed in workflow run that fromTag is never reported in the output. e.g.,

Run mikepenz/release-changelog-builder-action@v5
  with:
    mode: HYBRID
    toTag: v1.7.0
    configurationJson: {
    "template": "#{{CHANGELOG}}",
    "categories": [
    .......

May you advise what I'm doing wrong in this?

@mikepenz
Copy link
Owner

Thanks for the report.

From the past I remember that others had squash and merge working.

One noteworthy point is that you currently use HYBRID mode. which will do a combination of commits and pull requests.

Given you do squash&merge -> there won't be any commits left from the history of the individual PRs.

Is the repo in question open source?

@khaled-cr
Copy link
Author

Thanks Mike for your quick response.
The repo is private under org acount.

I tried with mode PR and still don't get the commits extracted into the changelog.

produced change log with mode: "PR"

[v1.8.0]

💬 Other
Cl test4
PR: 105

While commits under that PR include:

fixed: fix for merge and squash - fixed
...
added: added fix for merge and squash - added

@mikepenz
Copy link
Owner

Please set-up a demo project which allows to have a closer look at what exactly you face.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants