Giter Site home page Giter Site logo

mikepenz / release-changelog-builder-action Goto Github PK

View Code? Open in Web Editor NEW
664.0 8.0 95.0 11.22 MB

A GitHub action that builds your release notes / changelog fast, easy and exactly the way you want.

Home Page: https://blog.mikepenz.dev

License: Apache License 2.0

TypeScript 99.88% JavaScript 0.11% Shell 0.01%
action changelog release release-automation release-notes automation workflow github-actions actions ci

release-changelog-builder-action's People

Contributors

ankiotomas avatar ccremer avatar chicco785 avatar ckdarby avatar dependabot[bot] avatar fhopfensperger avatar ggiambo avatar inakiabt avatar invakid404 avatar ipcjs avatar jnavb avatar leog avatar lerebear avatar mikepenz avatar mxcl avatar nhoelzl avatar sackcastellon avatar skysails avatar svengeance avatar wdoug avatar yuhao-su avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

release-changelog-builder-action's Issues

It's not detecting my labels.

I created and attached the release_notes label on some of my pull requests (merged) but it's going to non-categorized list (logs)

my config:

{
  "categories": [
    {
      "title": "## ๐Ÿš€ Release Notes",
      "labels": [
        "release_notes"
      ]
    }
  ],
  "ignore_labels": [],
  "sort": "ASC",
  "template": "${{CHANGELOG}}",
  "pr_template": "- ${{TITLE}} (#${{NUMBER}})",
  "empty_template": "- no changes",
  "label_extractor": [],
  "duplicate_filter": {
    "pattern": "\\[ABC-....\\]",
    "on_property": "title",
    "method": "match"
  },
  "transformers": [],
  "max_tags_to_fetch": 200,
  "max_pull_requests": 200,
  "max_back_track_time_days": 365,
  "exclude_merge_branches": [],
  "tag_resolver": {
    "method": "sort"
  },
  "base_branches": []
}

Sample pull requests

image

Logs

๐Ÿ“˜ Reading input values
๐Ÿ”– Resolve tags
๐Ÿš€ Load pull requests
  โ„น๏ธ Comparing myusername/ci_cd_flutter_poc - 'v1.2.0...v1.2.1'
  โ„น๏ธ Found 8 commits from the GitHub API for myusername/ci_cd_flutter_poc
  โ„น๏ธ Fetching PRs between dates 2021-09-13T12:05:04.000Z to 2021-09-13T12:22:18.000Z for myusername/ci_cd_flutter_poc
  โ„น๏ธ Retrieved 68 merged PRs for myusername/ci_cd_flutter_poc
  โ„น๏ธ Retrieved 8 release commits for myusername/ci_cd_flutter_poc
  
๐Ÿ“ฆ Build changelog
  โ„น๏ธ Sorted all pull requests ascending: ASC
  โ„น๏ธ Used 0 transformers to adjust message
  โœ’๏ธ Wrote messages for 5 pull requests
  โ„น๏ธ Ordered all pull requests into 3 categories
  โœ’๏ธ Wrote 0 categorized pull requests down
  โœ’๏ธ Wrote 5 non categorized pull requests down
  โœ’๏ธ Wrote 0 ignored pull requests down
  โ„น๏ธ Filled template

`commitMode` didn't produce output

Screenshot 2021-10-08 143403

Few things I noticed:

  • I have only one input for commitMode: "true" yet it says no configuration found.
  • On the Load Commit history step it found my 18 commits between last 2 tags, but then it seemed to pass down as pulled requests to the next step. Maybe just some formatting.
  • The final output on Create Release results with - no changes changelog.

Add Jira ticket URL to commit messages

Is there a way to have custom URL using regex from commit messages?
When creating release notes from commits, I would like those commits to point to the related Jira issue. E.g. this commit message: feat/MYPROJ-15-add-unit-tests would point to https://my.jira/MYPROJ-15
I tried to use a custom label to paste it after a URL but I couldn't figure it out how.

Dynamically ignore PRs

Follow up of #571

Problem

With the tag_resolver.filter and tag_resolver.transformer feature we can now filter and ignore tags when building a PR "diff" between 2 tags.
For example, it's possible to search for the "previous" version of a tag matching a prefix (e.g. api-v1.0.1 and api-v1.1.0 while ignoring client-v1.0.2 between). The action would then consider PRs between those api- tags and not treat client-v1.0.2 as the previous version of api-v1.1.0.

What's currently not easily doable is to ignore PRs that shouldn't make it into a changelog based on the tag value.
While one can configure ignore_labels, this is static and applies to all "release scopes".
The goal is to dynamically ignore PRs one certain conditions.

In the given example, a PR labelled documentation but meant for the api should only be included in the changelog if the release tag also contains api-. For any client releases, that PR should not be included.

Workaround

It should be possible to use the exhaustive option in the category labels. To make it dynamic, one would need to patch the config to all categories before building a changelog (e.g. with jq).
However, there's a limitation: If a category "bugfixes" is built with either bug or fix, when there's api label and exhaustive=true, then a PR would need both bug AND fix (before it was OR). Alternatively, only bug/api pairs or fix/api are allowed

Proposal 1

Add a config option filter_labels (name debatable).
Only PRs having one label from this list is further categorized based on other, additional labels.

This allows to categorize PRs based on labels like documentation or bug without requiring a scoped label, e.g. api/documentation and api/bug. One can just label documentation and based on the tag, the action would automatically figure out if a documentation PR is appropriate or not.

There is a limitation: Requiring a dedicated label for each "release scope" (e.g. api and client) works well for small list of release scopes. For highly dynamic release scopes it becomes more and more a pain to maintain those labels on GitHub. That's where Proposal 2 might be an alternative.

Allowing patterns would give even more flexibility:

  "filter_labels": [
    "chart/.+",
    "api"
  ]

Proposal 2

Extract a label from label extractor and then filter on those.
Consider the following config snippet:

  "ignore_labels": [
    "ignore"
  ],
  "label_extractor": [
    {
      "pattern": "^(?!\\[api\\])",
      "method": "replace",
      "target": "ignore",
      "on_property": "title"
    }
  ],

Any PR that doesn't have the [api] prefix at the beginning of the PR title internally gets the ignore applied, so that the action will ignore unrelated PRs. This label extractor feature already exists today, but somehow it doesn't really work.
I need to confirm/debug this first to exclude a config error. It's possible that this proposal is obsolete if that approach already works but I did an error on my end.

This method would be more flexible and dynamic due to not requiring an existing set of labels compared to Proposal 1, but it makes it more fragile (depending how good the pattern is).

tag_resolver.filter doesn't recognize previous tags

Summary

I'm testing out the new feature introduced in #569 .
It looks like given a pattern, it doesn't match any previous semver tags and instead falls back to the initial commit

Context

Given tags in this repository:

  • fronius-stack-0.1.2
  • fronius-stack-0.2.0
  • a bunch of others

Workflow: https://github.com/ccremer/charts/blob/d50315a9dbc83331adc260802b7f689bc879f25c/.github/workflows/changelog.yml

Actual behavior

From https://github.com/ccremer/charts/runs/4121893890?check_suite_focus=true

Configuration
 {
  "pr_template": "- ${{TITLE}} (#${{NUMBER}})",
  "categories": [
    {
      "title": "## ๐Ÿš€ Features",
      "labels": [
        "enhancement",
        "feature"
      ]
    },
    {
      "title": "## ๐Ÿ› ๏ธ Minor Changes",
      "labels": [
        "change"
      ]
    },
    {
      "title": "## ๐Ÿ”Ž Breaking Changes",
      "labels": [
        "breaking"
      ]
    },
    {
      "title": "## ๐Ÿ› Fixes",
      "labels": [
        "bug",
        "fix"
      ]
    },
    {
      "title": "## ๐Ÿ“„ Documentation",
      "labels": [
        "documentation"
      ]
    },
    {
      "title": "## ๐Ÿ”— Dependency Updates",
      "labels": [
        "dependency"
      ]
    }
  ],
  "template": "${{CATEGORIZED_COUNT}} changes since ${{FROM_TAG}}\n\n${{CHANGELOG}}",
  "label_extractor": [
    {
      "pattern": "^(?!\\[fronius-stack\\])",
      "method": "replace",
      "target": "ignore",
      "on_property": "title"
    }
  ],
  "tag_resolver": {
    "filter": {
      "pattern": "fronius-stack-(.+)"
    }
  }
}
Logs
๐Ÿ“˜ Reading input values
  โ„น๏ธ Configuration successfully loaded.
  
  
๐Ÿ”– Resolve tags
  (node:1576) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
  โ„น๏ธ Found 55 (fetching max: 200) tags from the GitHub API for ccremer/charts
  ๐Ÿ”– Resolved current tag (fronius-stack-0.2.0) from the 'github.context.ref'
  โ„น๏ธ Only one tag found for the given repository. Usually this is the case for the initial release.
  /usr/bin/git rev-list --max-parents=0 HEAD
  89032f1d7504ee71d95e937f0f275fdb5cde4ed2
  ๐Ÿ”– Resolved initial commit (89032f1d7504ee71d95e937f0f275fdb5cde4ed2) from 'git rev-list --max-parents=0 HEAD'
  ๐Ÿ”– Resolved previous tag (89032f1d7504ee71d95e937f0f275fdb5cde4ed2) from the tags git API
  
๐Ÿš€ Load pull requests
  โ„น๏ธ Comparing ccremer/charts - '89032f1d7504ee71d95e937f0f275fdb5cde4ed2...fronius-stack-0.2.0'
  โ„น๏ธ Found 220 commits from the GitHub API for ccremer/charts
  โš ๏ธ Adjusted 'fromDate' to go max 365 back
  โ„น๏ธ Fetching PRs between dates 2020-11-05T21:04:07.000Z to 2021-11-05T21:04:07.000Z for ccremer/charts
  โ„น๏ธ Retrieved 63 merged PRs for ccremer/charts
  โ„น๏ธ Retrieved 220 release commits for ccremer/charts
  
๐Ÿ“ฆ Build changelog
  โ„น๏ธ Sorted all pull requests ascending: ASC
  โ„น๏ธ Used 0 transformers to adjust message
  โœ’๏ธ Wrote messages for 63 pull requests
  โ„น๏ธ Ordered all pull requests into 6 categories
  โœ’๏ธ Wrote 6 categorized pull requests down
  โœ’๏ธ Wrote 57 non categorized pull requests down
  โœ’๏ธ Wrote 0 ignored pull requests down
  โ„น๏ธ Filled template
Generated release changelog
6 changes since 89032f1d7504ee71d95e937f0f275fdb5cde4ed2
  
  ## ๐Ÿ“„ Documentation
  
  - [fronius-stack] Bogus change to test changelog generator (#93)
  
  ## ๐Ÿ”— Dependency Updates
  
  - Update helm/chart-releaser-action action to v1.2.1 (#63)
  - Update docker.io/emby/embyserver Docker tag to v4.6.0.50 (#62)
  - Update module github.com/gruntwork-io/terratest to v0.34.7 (#64)
  - Update module github.com/gruntwork-io/terratest to v0.35.1 (#71)
  - Update docker.io/library/telegraf Docker tag to v1.19 (#84)

Expected behaviour

The changelog should only be containing PR #93 and diff from tag fronius-stack-0.1.2, e.g.

1 changes since fronius-stack-0.1.2
  
  ## ๐Ÿ“„ Documentation
  
  - [fronius-stack] Bogus change to test changelog generator (#93)

feature request: Filter PR with certain label

Thanks for building this wonderful tool.

Is there is a way to filter PR with certain label?

Right Now, I use ignore_labels to do this but it is not as clear as I hope.

My use case is like this.

I use https://github.com/actions/labeler to label certain project, like proj-a

When I build changelog, I want to build the changelog only related to proj-a since the release is for project a in this repo.

Change

Sorry - maybe it is really a stupid question. But I always have in the body no message.

tag_name: refs/tags/1.5.287
release_name: refs/tags/1.5.287
body: - no changes
draft: false
prerelease: false
env:
GITHUB_TOKEN: ***

I am doing a PR and merge the PR into my dev branch. I tried to use labels like feature, fix, test. but still i have nothing in the body.

Use global .GitHub folder if local one doesn't exist

I have loads of repositories however the config I use is the same for them all.

I use another action that will check the global .GitHub folder for the configuration file if it doesn't exist in the local repo .GitHub file.

Would it be possible to do this?

Error: The process '/usr/bin/git' failed with exit code 128

So im trying to create my first workflow in order to create a good and automate changelog, but i think im missing in something because i cant stop getting this error.

I want to use as a trigger the push to main, in this case to confirm the merge of the PR, what do u recommend me? This is my error.
image

And this is the changelog.yml

name: changelog

on:
  push:
    branches:
      - main
    paths-ignore:
      - 'package.json'
      - 'CHANGELOG.md'
jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - name: Release Changelog Builder
        uses: mikepenz/[email protected]
        with:
          fetch-depth: 0 
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Label extractor question

Hi! I am experimenting with this action, but I'm having troubles while extracting the labels from my PR titles. I have the following naming convention: <type>: <title>. Some examples: feat: Add new button to menu, fix: Remove line causing bug. What could be the right pattern for my case?

Here is my current configuration:

{
  "categories": [
    {
      "title": "## ๐Ÿš€ New Features",
      "labels": ["feat"]
    },
    {
      "title": "## ๐Ÿ› Fixes",
      "labels": ["fix"]
    },
    {
      "title": "## ๐Ÿงช Tests",
      "labels": ["test"]
    },
    {
        "title": "## ๐Ÿ“ฆ Dependencies",
        "labels": ["deps"]
    },
    {
      "title": "## ๐Ÿ“– Documentation",
      "labels": ["docs"]
    },
    {
      "title": "## ๐Ÿงน Chores",
      "labels": ["chore"]
    }
  ],
  "ignore_labels": [
    "ignore"
  ],
  "sort": "ASC",
  "template": "${{CHANGELOG}}\n\n<details>\n<summary>Uncategorized</summary>\n\n${{UNCATEGORIZED}}\n</details>",
  "pr_template": "- ${{TITLE}}\n   - PR: #${{NUMBER}} labels: ${{LABELS}}",
  "empty_template": "- no changes",
  "label_extractor": [
    {
      "pattern": "^feat",
      "target": "feat",
      "on_property": "title"
    },
    {
      "pattern": "^test",
      "target": "test",
      "on_property": "title"
    },
    {
      "pattern": "^build",
      "target": "deps",
      "on_property": "title"
    },
    {
      "pattern": "^fix",
      "target": "fix",
      "on_property": "title"
    },
    {
      "pattern": "^docs",
      "target": "docs",
      "on_property": "title"
    },
    {
      "pattern": "^doc",
      "target": "docs",
      "on_property": "title"
    },
    {
      "pattern": "^chore",
      "target": "chore",
      "on_property": "title"
    }
  ]
}

I have tried several patterns but none seems to work (I'm new with regex).

Thanks in advance.

Bypass shallow clone issue?

I'm working to add support changelog generation using this project (and moving away from the old create release support marvinpinto/action-automatic-releases) in conjunction with softprops/action-gh-release.

Here is the smallest sample I could narrow down:

  name: build-artifact
  on:
    push:
      branches:
        - main

  jobs:
    build:
      runs-on: ubuntu-latest

      steps:
        - name: Checkout repository
          id: checkout_repository
          uses: actions/checkout@v2

        - name: Build changelog
          id: build_changelog
          uses: mikepenz/release-changelog-builder-action@v2
          env:
            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

The idea is to generate a changelog from the last released tag against all merged PRs (or direct commits to the main branch).

Unfortunately, this is the issue I experience on Github actions:

Run mikepenz/release-changelog-builder-action@v2
  with:
    ignorePreReleases: true
    failOnError: false
    commitMode: false
  env:
    GITHUB_TOKEN: ***

๐Ÿ“˜ Reading input values
  /usr/bin/git rev-list --tags --skip=0 --max-count=1
  /usr/bin/git describe --abbrev=0 --tags 
  fatal: No names found, cannot describe anything.
  Error: The process '/usr/bin/git' failed with exit code 128

My understanding is that because actions/checkout makes a shallow clone, there are no tags fetched.
Nowhere in the documentation there is any mention about this issue, which hints me that either I am doing something wildly wrong, or there is a missing step somewhere (not represented in the full example).

I'm thinking something like this:

jobs:
    steps:
      - name: Checkout repository
        id: checkout_repository
        uses: actions/checkout@v2
        with:
          fetch-depth: 0

Or maybe like this (sometimes the previous one doesn't cut it):

jobs:
    steps:
      - name: Checkout repository
        id: checkout_repository
        uses: actions/checkout@v2

     - name: Unshallow repository checkout
       run: git fetch --prune --unshallow

Unfortunately, depending of the size of the repository, this may be impossible to do.
Any feedback would be appreciated.

empty template being output as changelog despite changes being present

Despite the fact that the action is able to resolve the tag and determine there are changes between them, it outputs the default "no changes" as the changelog.

image

My example config is as follows:

    runs-on: macos-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - name: "Build Changelog"
        id: build_changelog
        uses: mikepenz/[email protected]
        with:
          owner: ${{ github.repository_owner }}
          configuration: changelog-config.json
          repo: test-repo
          fromTag: v.0.15.0
          toTag:  v.0.19.0
          failOnError: true
          commitMode: true
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

I've tried outputting to a file as well, same result. I've also tried with commitMode set to true and false with no success. Removing the toTag and fromTag makes no difference as well. It always outputs - no changes as the changelog

Configuration file not found or parsed wrong

I have a the following steps in my .github/workflows/ci.yml file:

name: 'CI'
on:
  push:
    tags:
      - 'v*'
  pull_request:
  
jobs:
  release:
    if: startsWith(github.ref, 'refs/tags/')
    runs-on: ubuntu-latest
    steps:
      - name: Build Changelog
        id: github_release
        uses: mikepenz/[email protected]
        with:
          configuration: "configs/configuration.json"        
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Create Release
        uses: actions/create-release@v1
        with:
          tag_name: ${{ github.ref }}
          release_name: ${{ github.ref }}
          body: ${{steps.github_release.outputs.changelog}}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

I provided the following configuration file at configs/configuration.json:

{
    "categories": [
        {
            "title": "## Features",
            "labels": [
                "feature"
            ]
        },
        {
            "title": "## Fixes",
            "labels": [
                "fix"
            ]
        },
        {
            "title": "## Other",
            "labels": [
                "other"
            ]
        },
        {
            "title": "## Chores",
            "labels": [
                "chore"
            ]
        },
        {
            "title": "## Documentation",
            "labels": [
                "docs"
            ]
        }
    ]
}

I tried a simple configuration first but I wanted to add different titles and multiple labels but i get the following warning when the gh-action is executed:

image

I tagged my PRs with only the labels provided in the configuration. My release notes look like this:

image

Did I do something wrong?

body: - no changes ?

Hello @mikepenz I maybe have a misconfiguration and I am trying to figure out how to make your github action work. So, sorry if this issue is not completely relevant...

I used the example you provide in the readme and I make PR on my project:

When I add a tag, the action works fine, but it results with a no changes body... Did I miss something ?
image

Missing PRs (merged PR lost) in changelog

I noticed some merged PRs which are also shown in the commits log in the main branch are not shown in the changelog.

The following info indicated fewer PRs fetched than the release commits. This rise my confusion because we are using the squash and merge model for our PRs, which means PRs fetched should always be equal to the commits.

โ„น๏ธ Retrieved 287 merged PRs for xxx/xxxx
โ„น๏ธ Retrieved 350 release commits for xxx/xxxx

Resolved `fromTag` is missing from outputs

I noticed while using this in a private repository that the fromTag output listed in the "Action outputs" section of the docs doesn't appear to be set correctly.

It seems like this is due to an omission in the code. Whereas the toTag output is set correctly here:

this.toTag = thisTag
core.setOutput('toTag', thisTag)
core.debug(`Resolved 'toTag' as ${thisTag}`)

The corresponding line to set the fromTag appears to be missing:

this.fromTag = previousTag
core.debug(`fromTag resolved via previousTag as: ${previousTag}`)

feature request

First of all, this is a create tool. Thank you for making this.

In commit mode, is it possible to use sha in template?

Unable to retrieve previous tag

Hi,

I try to use release-changelog-builder-action but I get this error :

Error: ๐Ÿ’ฅ Unable to retrieve previous tag given 0.1.0

image

my workflow file is :

name: Test Build Changelog

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  workflow_dispatch:

jobs:
  build:
    runs-on: windows-latest  

    steps:
    - name: Checkout
      uses: actions/checkout@v2
      with:
        fetch-depth: 0

    - name: "Build Changelog"
      id: build_changelog
      uses: mikepenz/[email protected]
      with:
        failOnError: true
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

    - name: "Print Changelog"
      run: echo ${{steps.build_changelog.outputs.changelog}}

And currently my repository looks like :

image

Did I missed something ?

Resolve tags (node:1671) [DEP0005] Error: Not Found

Was trying to use this really handy action from the looks of it, but I'm always getting this error

Resolve tags (node:1671) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. Error: Not Found

Would really appreciate some insight

It stops the workflow even if I pass the argument failOnError: false

Current step yml
- name: Release Changelog Builder id: build_changelog uses: mikepenz/[email protected] with: configuration: ".github/changelog_config.json" owner: "Random Name" commitMode: true fromTag: "poc" toTag: "latest" failOnError: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Current config file
{ "categories": [ { "title": "#### New Features โœ…", "labels": ["feature"] }, { "title": "#### BugFixes ๐Ÿ›", "labels": ["fix"] }, { "title": "#### Improved ๐ŸŽ‰", "labels": ["improvement"] }, { "title": "#### Breaking Changes ๐Ÿ› ", "labels": ["bchange"] }, { "title": "#### Other changes โž•", "labels": ["misc"] }, { "title": "#### Dependencies ๐Ÿ“Ž", "labels": ["dependencies"] } ], "ignore_labels": [ "ignore" ], "sort": "ASC", "template": "## Changelog - {RELEASE_DATE}\n\n${{CHANGELOG}}\n\n<**Full Commits Changelog**: https://github.com/{GIT_REPO}/commits/{RELEASE_TAG}\n\ndetails>\n<summary>Uncategorized</summary>\n\n${{UNCATEGORIZED}}\n</details>", "empty_template": "- no changes", "max_tags_to_fetch": 15, "max_back_track_time_days": 90, "base_branches": ["master"] }

A bunch of unexpected behaviour

Sorry for the not very specific title, but having a few issues!

Firstly, the exhaustive setting does not appear to be working as expected. Despite having this enabled for each category (features, fixes, tests) on a category label plus a product label, features are appearing in the fixes list, etc.

Secondly, date ranges between tags don't seem to be resolving properly. Despite finding the right tag range (@neo4j/[email protected]...@neo4j/[email protected]), the date range that it infers from that (2021-11-01T10:03:42.000Z to 2021-12-01T13:39:00.000Z), as the previous tag was made 22 days ago, so just over a week over what it's some up with as the start date.

Any ideas on the above? Thanks for any help!

Full log below:

Run mikepenz/release-changelog-builder-action@v1
  with:
    configuration: config/release-changelog-builder-action/configuration-graphql.json
    toTag: @neo4j/[email protected]
    ignorePreReleases: false
    failOnError: false
    commitMode: false
  env:
    GITHUB_TOKEN: ***

๐Ÿ“˜ Reading input values
  
  
  
๐Ÿ”– Resolve previous tag
  โ„น๏ธ Found 57 (fetching max: 200) tags from the GitHub API for neo4j/graphql
๐Ÿš€ Load pull requests
  โ„น๏ธ Comparing neo4j/graphql - '@neo4j/[email protected]...@neo4j/[email protected]'
  โ„น๏ธ Found 271 commits from the GitHub API for neo4j/graphql
  โ„น๏ธ Fetching PRs between dates 2021-11-01T10:03:42.000Z to 2021-12-01T13:39:00.000Z for neo4j/graphql
  โ„น๏ธ Retrieved 173 merged PRs for neo4j/graphql
  โ„น๏ธ Retrieved 271 release commits for neo4j/graphql
๐Ÿ“ฆ Build changelog
  โ„น๏ธ Sorted all pull requests ascending: ASC
  โ„น๏ธ Used 1 transformers to adjust message
  โœ’๏ธ Wrote messages for 24 pull requests
  โ„น๏ธ Ordered all pull requests into 3 categories
  โœ’๏ธ Wrote 18 categorized pull requests down
  โœ’๏ธ Wrote 6 non categorized pull requests down
  โœ’๏ธ Wrote 0 ignored pull requests down
  โ„น๏ธ Filled template

Configuration below:

{
    "categories": [
        {
            "title": "## ๐Ÿš€ Features",
            "labels": ["feature", "graphql"],
            "exhaustive": true
        },
        {
            "title": "## ๐Ÿ› Fixes",
            "labels": ["fix", "graphql"],
            "exhaustive": true
        },
        {
            "title": "## ๐Ÿงช Tests",
            "labels": ["test", "graphql"],
            "exhaustive": true
        }
    ],
    "tag_resolver": {
        "method": "sort"
    }
}

Identify breaking changes

Hey, It would be good if this would identify any breaking changes.

for example, I can add a "breaking" label (or based on semver changes) that would be in addition to say adding a "feature" which then would flag this feature as a breaking change.

currently there is no way to identify a breaking change that i can see without manually editing the release.

Label extractor method match not working

Hey,

I tried using the new match label extractor method, but for some reason it does not return the desired release note. It might be a misconfiguration on my side.
I have the following naming convention: [test][ABC-123] - PR title
Expected output would be to put the PRs under the corresponding title based on the [test] and etc labels, but it puts it all of them under uncategorized. Any idea on what I did wring?

This is the configuration I use:

{
    "categories": [
      {
        "title": "## Features",
        "labels": ["[feature]"]
      },
      {
        "title": "## Fixes",
        "labels": ["[fix]"]
      },
      {
        "title": "## Tests",
        "labels": ["[test]"]
      },
      {
        "title": "## Other",
        "labels": []
      }
    ],
    "ignore_labels": [
      "ignore"
    ],
    "sort": "ASC",
    "template": "${{CHANGELOG}}",
    "pr_template": "- ${{TITLE}} @${{AUTHOR}}",
    "empty_template": "- no changes",
    "label_extractor": [
      { 
        "pattern": "\\[feature\\]|\\[test\\]|\\[bug\\]|\\[fix\\]|\\[bugfix\\]|\\[duplicate\\]", 
        "on_property": "title", 
        "method": "match" 
      } 
    ],
  "transformers": [
    {
      "pattern": "[\\-\\*] (\\[(X.+?)\\])(\\[(X.+?)\\])( )?(.+?)\n(.+?[\\-\\*] )(.+)",
      "target": "- $6\n  - FIX https://somelink.net/secure/RapidBoard.jspa?rapidView=783&projectKey=SPE&modal=detail&selectedIssue=$2\n  - FIX https://somelink.net/secure/RapidBoard.jspa?rapidView=783&projectKey=SPE&modal=detail&selectedIssue=$4 | $8"
    },
    {
      "pattern": "[-\\*] (\\[(X.+?)\\])(\\[(.+?)\\])?( )?(.+?)\n(.+?[\\-\\*] )(.+)",
      "target": "- $6\n  - FIX https://somelink.net/secure/RapidBoard.jspa?rapidView=783&projectKey=SPE&modal=detail&selectedIssue=$2 | $8"
    },
    {
      "pattern": "[\\-\\*] (\\[(...|TEST|CI|SKIP)\\])( )?(.+?)\n(.+?[\\-\\*] )(.+)",
      "target": "- $4\n  - $6"
    }
  ],
    "max_tags_to_fetch": 200,
    "max_pull_requests": 200,
    "max_back_track_time_days": 365,
    "exclude_merge_branches": [
      "Owner/qa"
    ],
    "tag_resolver": {
      "method": "semver"
    },
    "base_branches": [
      "master"
    ]
}

Thanks!

Usage info for parallel releases support

First of all, congrats for this great repo.

Iยดve read on the docs that parallel releases are supported but Iยดm not able to configure it correctly so maybe I got a different concept of it.

Iยดll try to explain what I want to achieve. I got a master/main branch where tags get pushed to, additionally at feature branches there are also tags to release partial features. All branches have Pull Requests associated, so an example would be:

master (0.0.1, 0.0.2...)
  featureA (0.0.1-featureA.1, 0.0.1-featureA.2 ...)
     ticket-1
     ticket-2
  featureB (0.0.1-featureB.1, 0.0.1-featureB.2 ...)
     ticket-3
     ticket-4

Is this structure supported?

If it is not, could I get at least the changelog for the master tags? (0.0.1, 0.0.2...) Every pull requests gets not categorized, I tried to replicate some of your projects with this actions with no result.

Here is a test repository

Label extractor `on_property` as both body and head

Was just wondering if it would be possible to support the label_extractor "on_property": "title&head" or some similar syntax to perform the label extraction on both properties at once. Reason being, its tedious (and error prone) to have same sets of regex dealing with two different properties. For example, this is currently what I had to do - https://github.com/titu1994/NeMo/blob/changelog_builder/.github/workflows/config/changelog-config.json#L44-L152 and it works well, its just error prone.

Pipeline result - https://github.com/titu1994/NeMo/runs/4960957329?check_suite_focus=true

Add and push the changelog file to repository

Hi

I try to add, commit and push the output change log file to the repository.

name: build-version-workflow

on: push 
jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/[email protected]
        with:
          fetch-depth: 1
      - name: Build Changelog
        id: build_changelog
        uses: mikepenz/release-changelog-builder-action@v1
        with: 
          commitMode: true
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - name: Create local changes
        run: |
          git add ${{steps.build_changelog.outputs.changelog}}
      - name: Commit files
        run: |
          git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
          git config --local user.name "github-actions[bot]"
          git commit -am "Change Log Created / Updated"
      - name: Push changes
        uses: ad-m/github-push-action@master
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          branch: ${{ github.ref }}

But the ouptut file does not seems to be a path...and when I try to add it (btw I am using this github actions for push : https://github.com/marketplace/actions/github-push) it fails with this error :

Run git add - no changes
fatal: pathspec '-' did not match any files

I thought it was related to the push actions but I noticed that the git add is actually pointing to empty path...
I am not sur on what I am doing wrong here. Did I reference the output changelog file correctly ?

Any help on that would be more than welcome !

Label extraction doesn't make sense

Hello, I've been using this action for a while now and I'm loving it, but there's a thing I just can't wrap my head around.
Label extraction is very counter-intuitive. I'd expect that label extraction matches the given value against the pattern and uses the target as a label, but apparently, it replaces the pattern with the target and uses that as a label.
Is this intended behavior, and if yes, how is this expected to work with multiline values? My use case is that I want to look for specific headers in the PR body and use its name as a label. For example, I want to match ## Feature: and extract "feature" to use as a label. Is this possible with the current implementation?
Also, doesn't it make sense to match labels in a case-insensitive way? GitHub doesn't consider label names to be case-sensitive, so shouldn't this be reflected in this action?

[bug]: Failed build from no names found

Run mikepenz/release-changelog-builder-action@v2
/usr/bin/docker exec  7c5faac10627816750acbe1904cdd48fa7fab1204d4e09f3548c8335864b2001 sh -c "cat /etc/*release | grep ^ID"

๐Ÿ“˜ Reading input values
๐Ÿ”– Resolve tags
  โ„น๏ธ Found 8 (fetching max: 200) tags from the GitHub API for T145/black-mirror
  /usr/bin/git rev-list --tags --skip=0 --max-count=1
  /usr/bin/git describe --abbrev=0 --tags 
  fatal: No names found, cannot describe anything.
  Error: The process '/usr/bin/git' failed with exit code 128

https://github.com/T145/black-mirror/runs/4003988476?check_suite_focus=true#step:6:20

I'm simply using the action like so:

- name: Build Changelog
        uses: mikepenz/release-changelog-builder-action@v2
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Before releasing and am unsure why it's failing.

Add option to edit existing release

Problem

Let's consider a GitHub workflow where the GH release is created by another action, but doesn't provide a good release changelog. It would be cool if this changelog action can edit a release changelog of a release that already exists.

The main reason I'm asking this is because some actions do not allow to customize the release changelog. And even if such option is requested as a feature, the maintainers might be inactive or reject such a config option.
Example: https://github.com/helm/chart-releaser-action

Proposal

Add a config flag that replaces the body of an existing GH release if it finds one. I'm open to the name, but could be something like replaceExistingRelease or editExistingReleaseBody

This action would then be placed after another action created the release.

Update docs with additional information on using checkout

If using this action in a workflow triggered by push on something other than refs/tags, e.g.

on:
  push:
    branches:
      - 'main'

it is necessary to specify a fetch-depth of 0 in order for tag information to be included in the repo. Otherwise this action's git command will fail when attempting to describe the repo's tags.

      - uses: actions/checkout@v2
        with:
          fetch-depth: 0 # indicates all history for all branches and tags. needed for changelog.

PRs get ignored in the changelog for no apparent reason

Hi

I'm not sure if it's an issue with the action itself or whether we use it incorrectly.

Preconditions:

  1. We are using v1.3.1 of this action. It's maybe notable that there was a version upgrade from 1.2.3 to 1.3.1 between rc2 and rc3
  2. We use the new feature outputFile in config
  3. We use a custom config

New release:

  1. We have released a new prerelease: v1.0.0-rc3
  2. It shows the changelog, but some PRs are missing, compared to v1.0.0-rc2. I understand the ignorePrereleases setting as if previous releases wouldn't exist, so it builds the changelog from the last "stable" release. Examples:

Logs

๐Ÿ“˜ Reading input values
  ๐Ÿ”– Resolved current tag (v1.0.0-rc3) from the 'github.context.ref'
๐Ÿ”– Resolve previous tag
  โ„น๏ธ Found 24 (fetching max: 200) tags from the GitHub API for vshn/k8up
  โ„น๏ธ Enabled 'ignorePreReleases', searching for the closest release
๐Ÿš€ Load pull requests
  โ„น๏ธ Comparing vshn/k8up - 'v0.1.10...v1.0.0-rc3'
  โ„น๏ธ Found 250 commits from the GitHub API for vshn/k8up
  โš ๏ธ Adjusted 'fromDate' to go max 90 back
  โ„น๏ธ Fetching PRs between dates 2020-10-13T16:24:24.000Z to 2021-01-11T16:24:24.000Z for vshn/k8up
  โ„น๏ธ Retrieved 57 merged PRs for vshn/k8up
  โ„น๏ธ Retrieved 250 release commits for vshn/k8up
๐Ÿ“ฆ Build changelog
  โ„น๏ธ Sorted all pull requests ascending: ASC
  โ„น๏ธ Used 1 transformers to adjust message
  โœ’๏ธ Wrote messages for 57 pull requests
  โ„น๏ธ Ordered all pull requests into 6 categories
  โœ’๏ธ Wrote 57 categorized pull requests down
  โœ’๏ธ Wrote 0 non categorized pull requests down
  โœ’๏ธ Wrote 0 ignored pull requests down
  โ„น๏ธ Filled template

Also interesting is this 250 commits. Is this just by coincidence or some internal limit? If it's a limit, it's not based on the history, since those missing PRs are seemingly random in the history (so no "filtered out oldest PRs"). The mentioned PRs also fit into the "90 days back" window.

Do you have an answer? Or is my expectation wrong?

Generated change log is "no changes" when only providing current commit hash as "toTag"

I would like to generate a change log for all PRs merged from the last tag to a provided commit hash.

Currently my build workflow is configured as:

    - name: Build Changelog
      id: github_release
      uses: mikepenz/[email protected]
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        configuration: ./.github/config/changelog-config.json
        toTag: ${{ github.sha }}

This results in the follow output:

Run mikepenz/[email protected]
  with:
    ignorePreReleases: false
    failOnError: false
    commitMode: false
  env:
    AWS_DEFAULT_REGION: us-east-1
    AWS_REGION: us-east-1
    AWS_ACCESS_KEY_ID: ***
    AWS_SECRET_ACCESS_KEY: ***
    GITHUB_TOKEN: ***
    toTag: f3e5bd0a5ded0fa93d05fb3aba8f8258e92fb589

::set-output name=failed::false
##[debug]steps.github_release.outputs.failed='false'
::group::๐Ÿ“˜ Reading input values
๐Ÿ“˜ Reading input values
  ##[debug]GITHUB_WORKSPACE = '/home/runner/work/*redacted repo*/*redacted repo*'
  ##[debug]repositoryPath = '/home/runner/work/*redacted repo*/*redacted repo*'
  โ„น๏ธ Configuration not provided. Using Defaults.
  
  ::set-output name=owner::*redacted org*
  ##[debug]steps.github_release.outputs.owner='*redacted org*'
  ##[debug]Resolved 'owner' as *redacted org*
  
  ::set-output name=repo::*redacted repo*
  ##[debug]steps.github_release.outputs.repo='*redacted repo*'
  ##[debug]Resolved 'repo' as *redacted repo*
  ::endgroup::
::group::๐Ÿ”– Resolve tags
๐Ÿ”– Resolve tags
  (node:2145) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
  โ„น๏ธ Found 1 (fetching max: 200) tags from the GitHub API for *redacted org*/*redacted repo*
  /usr/bin/git rev-list --tags --skip=0 --max-count=1
  b9eb482497e5af4d5ae10c8afeaa7fe604d69189
  /usr/bin/git describe --abbrev=0 --tags b9eb482497e5af4d5ae10c8afeaa7fe604d69189
  1.0.0
  ๐Ÿ”– Resolved current tag (1.0.0) from 'git rev-list --tags --skip=0 --max-count=1'
  ##[debug]fromTag undefined, trying to resolve via API
  โ„น๏ธ Only one tag found for the given repository. Usually this is the case for the initial release.
  /usr/bin/git rev-list --max-parents=0 HEAD
  6b2296152fbd03928af594288c5fd5f85fb73fc3
  ๐Ÿ”– Resolved initial commit (6b2296152fbd03928af594288c5fd5f85fb73fc3) from 'git rev-list --max-parents=0 HEAD'
  ๐Ÿ”– Resolved previous tag (6b2296152fbd03928af594288c5fd5f85fb73fc3) from the tags git API
  
  ::set-output name=toTag::1.0.0
  ##[debug]steps.github_release.outputs.toTag='1.0.0'
  ##[debug]Resolved 'toTag' as 1.0.0
  ##[debug]fromTag resolved via previousTag as: 6b2296152fbd03928af594288c5fd5f85fb73fc3
  ::endgroup::
::group::๐Ÿš€ Load pull requests
๐Ÿš€ Load pull requests
  โ„น๏ธ Comparing *redacted org*/*redacted repo* - '6b2296152fbd03928af594288c5fd5f85fb73fc3...1.0.0'
  โ„น๏ธ Found 1371 commits from the GitHub API for *redacted org*/*redacted repo*
  โš ๏ธ Adjusted 'fromDate' to go max 365 back
  โ„น๏ธ Fetching PRs between dates 2020-11-15T15:01:15.000Z to 2021-11-15T15:01:15.000Z for *redacted org*/*redacted repo*
  Warning: โš ๏ธ Reached 'maxPullRequests' count 200
  โ„น๏ธ Retrieved 280 merged PRs for *redacted org*/*redacted repo*
  โ„น๏ธ Retrieved 1371 release commits for *redacted org*/*redacted repo*
  
  ::set-output name=pull_requests::68,89,96,320,325,330,333,334,332,336,341,331,348,351,356,357,359,364,363,367,368,369,370,371,372,360,376,375,377,378,379,384,385,387,383,390,392,397,396,395,399,401,398,402,404,407,409,410,412,416,432,433,435,436,443,444,447,448,451,449,453,454,455,459,458,460,462,461,463,464,465,466,467,469,468,470,471,472,473,475,476,477,478,479,480,484,485,481,487,482,488,489,490,491,492,493,486,494,496,497,498,499,500,501,502,504,505,507,509,511,513,512,516,515,518,514,517,519,520,521,524,522,525,526,527,532,530,531,533,534,538,536,537,539,540,541,544,546,545,549,548,547,552,556,553,557,559,561,563,564,508,554,565,566,567,568,569,570,573,574,575,576,577,578,579,571,580,582,572,583,584,581,586,587,588,589,590,593,594,596,597,598,599,601,602,606,607,608,610,612,611,626,620,629,630,631,633,634,636,635,637,638,639,640,642,613,641,643,644,645,646,648,647,654,655,656,652,657,653,651,659,663,661,665,660,667,669,671,672,673,674,675,678,679,680,683,684,670,686,690,691,689,694,697,696,692,698,699,703,705,702,708,704,706
  ##[debug]steps.github_release.outputs.pull_requests='68,89,96,320,325,330,333,334,332,336,341,331,348,351,356,357,359,364,363,367,368,369,370,371,372,360,376,375,377,378,379,384,385,387,383,390,392,397,396,395,399,401,398,402,404,407,409,410,412,416,432,433,435,436,443,444,447,448,451,449,453,454,455,459,458,460,462,461,463,464,465,466,467,469,468,470,471,472,473,475,476,477,478,479,480,484,485,481,487,482,488,489,490,491,492,493,486,494,496,497,498,499,500,501,502,504,505,507,509,511,513,512,516,515,518,514,517,519,520,521,524,522,525,526,527,532,530,531,533,534,538,536,537,539,540,541,544,546,545,549,548,547,552,556,553,557,559,561,563,564,508,554,565,566,567,568,569,570,573,574,575,576,577,578,579,571,580,582,572,583,584,581,586,587,588,589,590,593,594,596,597,598,599,601,602,606,607,608,610,612,611,626,620,629,630,631,633,634,636,635,637,638,639,640,642,613,641,643,644,645,646,648,647,654,655,656,652,657,653,651,659,663,661,665,660,667,669,671,672,673,674,675,678,679,680,683,684,670,686,690,691,689,694,697,696,692,698,699,703,705,702,708,704,706'
  ::endgroup::
::group::๐Ÿ“ฆ Build changelog
๐Ÿ“ฆ Build changelog
  โ„น๏ธ Sorted all pull requests ascending: ASC
  โ„น๏ธ Used 0 transformers to adjust message
  โœ’๏ธ Wrote messages for 254 pull requests
  โ„น๏ธ Ordered all pull requests into 3 categories
  โœ’๏ธ Wrote 0 categorized pull requests down
  โœ’๏ธ Wrote 254 non categorized pull requests down
  โœ’๏ธ Wrote 0 ignored pull requests down
  โ„น๏ธ Filled template
  ::endgroup::

::set-output name=changelog::- no changes
##[debug]steps.github_release.outputs.changelog='- no changes'
##[debug]Node Action run completed with exit code 0
##[debug]Finishing: Build Changelog

It would appear the toTag value is ignored and replaced with the last tag which produces a change log range of 1.0.0 - 1.0.0 and results in the no changes output.

Multibranch changelog

Hi!

I'm having a hard time figuring out how to get my changelog generated when I use a main-dev-feature setup.

We develop in feature branches and merges to dev branch. If everything works alright in dev we merge to main and release it. When the action runs on the main branch it says no changes in the changelog. Probably because it has no pull requests directly.

Are there any way to solve this?

Configuration being ignored somehow?

Hey!

I've been trying to make use of this action, initially to show a preview of how release notes will look, as a comment in each PR.

My workflow yml is: https://github.com/Hammerspoon/hammerspoon/blob/master/.github/workflows/pr_release_note_preview.yml
and the configuration file is: https://github.com/Hammerspoon/hammerspoon/blob/master/.github/workflows/release_notes_config.json

I'm pretty sure they are correct, and I have a checkout action, but the comments that get put on PRs just say "* no changes", see: Hammerspoon/hammerspoon#2691 (comment)

I think that indicates that my configuration json isn't being applied properly, because I specified a different empty_template

If it helps, this should show the Actions run that produced that comment, with debug logging enabled: https://github.com/Hammerspoon/hammerspoon/runs/2022165003?check_suite_focus=true

What am I doing wrong? :)

Can we categorize pull requests by title?

I would like to be able to categorize pull requests based on pattern matching of their titles.

For example, if a pull request begins with fix: then treat it as a bugfix. Essentially conventional commits, but at a pull request level. I see the label_extractor, but if I am reading the Readme correctly it appears that only applies on pull request bodies, not titles, is that correct?

Thanks for this great action by the way!

Doing an echo to file may break content

Info: not the action itself executed the command, but a step afterwards (echo to file)

    - name: Make release notes
      run: echo "${{steps.build_changelog.outputs.changelog}}" > .github/release-notes.md

Hi

So something strange happened when we released https://github.com/vshn/k8up/releases/tag/v1.0.0-rc2:

image

In k8up-io/k8up#200, the title was

Disable LEADER_ELECTION by default for `make run run_kind`

which actually cause the action to execute make run run_kind:

$ cat Makefile
run: fmt vet
	go run ./main.go

That looks almost like a security issue to me? :)

at the very least it screws the changelog. Meanwhile I have edited the Title, but it's still unexpected

Using current head as `toTag`

Hello!

I'm currently running into an issue with my usage of this action. The way I'd like to use it is to generate the changelog by using all pull requests merged between the last tag, and the current head of the currently checked out branch. From the documentation, it seemed like the action really required having two tags. Is there a way to make it use the current head? Or is this a new feature that could potentially be added?

Currently I have a work-around that requires adding a step to create a new tag with the current head just before building the changelog. It's not too bad, but it's definitely inconvenient.

If that's of any help, here is the workflow I'm talking about : https://github.com/marier-nico/pr-bump/blob/main/.github/workflows/release.yml

Many thanks! ๐Ÿ˜„

Environment variable 'INPUT_BODY' exceeds the maximum supported length

hi just started using github in my team
i get this error
image
this results the entire history of my repo..

i use fetch-depth : "0"
if not it will throw error saying no tag found

if I am trying to specify toTag
i get this
image

i just want those changelog to work from the most recent tag to the current pushed tag

i am using commitMode

Thanks Guys!

Consider tag prefixes or pattern to build changelog

Problem

Consider cases where a mono-repository creates tags for multiple, different release "scopes".
For example, there could be tags like api-v1.0.2 and client-v2.2.3. If there's another release for api, the changelog for the api- prefixes should only contain the changes from the last api- release tag and not contain changes targeting the client

Real world examples:

Proposal 1

Add a config option to set a specific regex pattern to match tags.
Example: tagPattern: 'api-'
Tags:

- api-v1.0.1
- api-v1.1.0
- client-v1.0.2

Pushed tag: api-v1.1.0
The changelog action would ignore client-v1.0.2 since it doesn't match api- regex and use api-v1.0.1 instead.
This config option might be incompatible with other options, depending on implementation (you can answer that best I guess).

The pattern could also be computed from the pushed tag (e.g. drop the vx.x.x substring)
note: the v prefix might be optional as well for semver parsing.

Proposal 2

Add config option that only respects the same prefix (following a certain pattern).
Example: matchingTagPrefix: true
Tags:

- api-v1.0.1
- api-v1.1.0
- client-v1.0.2

Pushed tag: api-v1.1.0

The changelog action would detect that api- is a prefix to the actual version number. It then knows that client-v1.0.2 should be ignored (even though v1.0.2 is "more recent" than v1.0.1).
To make use of this option, release tags should follow a certain naming standard that needs to be documented, e.g. <prefix>-<semver>-<prerelease-suffix>

This proposal has the advantage over proposal 1 where one doesn't need to specify the pattern, it uses more of a "convention" instead. However, it may be less flexible and requires users to follow an opinionated naming scheme

Maybe both proposals could make sense. One could choose which one to use, but these may be exclusive depending on implementation. Though personally I'd favor proposal 1.

Categories not being mapped correctly.

I just started using this action and I've read the docs, so I'm just looking for some help on what I might be missing. I'd like to use the categories feature, however I'm having an issue getting them grouped properly. I think I'm just misunderstanding something with the label_extractor property. The PR titles on my repo are formatted as such:

[Feature][AB-1234] - this is a PR title message (#1)

I'd like PRs like that one to be grouped under the "Features" category, but it's not matching. This is what I have set up in my configuration file:
Categories:

"categories": [
    {
      "title": "## ๐Ÿš€ Features",
      "labels": ["[Feature]"]
    },
    {
      "title": "## ๐Ÿ› Fixes",
      "labels": ["[Bug]", "[Issue]"]
    },
    {
      "title": "## ๐Ÿงช Tests",
      "labels": ["[Test]"]
    }
  ]

Label Extractor:

"label_extractor": [
    {
      "pattern": "(\\[Feature\\]|\\[Issue\\])*",
      "target": "$1",
      "on_property": "title",
      "flags": "gu"
    }
  ]

Right now, it's finding the PR, but it's grouping it under "uncategorized", and I'm not sure what I'm doing wrong to get it set up under the "features" category. Any help is greatly appreciated!

Dynamic fromTag / toTag

Thank you for this nice action !
I want to have a changelog form current tag to previous tag, do you have any idea to make this dynamic to prevent a commit in yml ?

eg git log $(git describe --abbrev=0 --tags $(git describe --abbrev=0)^)...$(git describe --abbrev=0)
same like git log 2.16.0...2.15.3

- name: "Complex Configuration"
  id: build_changelog
  uses: mikepenz/release-changelog-builder-action@{latest-release}
  with:
    fromTag: "2.15.3" <----  how to make this dynamic my previous tag, eg "git describe --abbrev=0 --tags $(git describe --abbrev=0)^"
    toTag: "2.16.0" <----  how to make this dynamic my current tag, eg "git describe --tags"

[BUG] Unable to retrieve previous tag

Hi, I got the below error:

image

I haven't look at the code for this action yet, but it might be due to my versioning following [feature].[patch] instead of [major].[minor].[patch]

Add a configuration option to write the changelog to file

I'd love to combine Goreleaser's release pipeline with this action.
Although Goreleaser includes its own generator, it creates a changelog based on commits. But PRs can sometimes be a better option to convey a history to the human reader.

So, right now I'd have these steps:

    - name: "Build Changelog"
      id: build_changelog
      uses: mikepenz/[email protected]
      with:
        configuration: ".github/changelog-configuration.json"
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    - name: make release notes
      run: echo "${{steps.build_changelog.outputs.changelog}}" >> .github/release-notes.md
    - name: Publish releases
      uses: goreleaser/goreleaser-action@v2
      with:
        args: release --release-notes .github/release-notes.md
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

It would be cool to skip this intermediary step like this:

    - name: "Build Changelog"
      id: build_changelog
      uses: mikepenz/[email protected]
      with:
        configuration: ".github/changelog-configuration.json"
        outputFile: ".github/release-notes.md"
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    - name: Publish releases
      uses: goreleaser/goreleaser-action@v2
      with:
        args: release --release-notes .github/release-notes.md
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

WDYT?

Filter duplicates

Hi,

If there are multiple pull requests containing the same Jira issue number, is there a way to only show the latest?
Also is it possible to create a label extractor that finds tickets that contain a Jira issue number and only these are shown under the corresponding label? The ones missing Jira issue number would be shown under Uncategorized.
So for example if these are the PRs:

  • ABC - 123 Some feature
  • ABC - 123 Some feature
  • ABC - 456 Other feature
  • Some test ABC - 789

the output should be:
Release v1.0.0

  • ABC - 123 Some feature
  • ABC - 456 Other feature
  • ABC - 789 Some test
    Unzategorized:
  • Some PR without jira issue num

Changelog on PR's since last tag?

Sorry, more of a question but ... I have release workflow that is triggered manually on the main branch. In that workflow I have these steps: 1) checkout 2) install GitVersion 3) build and package in zip-file 4) generate changelog 5) create tag&release and publish.

The problem that I have is that the tag is created in step 5, where step 4 is taking the PR's from tag n and n-1. Is there a way to have the action get the PR's from the last tag until 'now' (so, without a new tag)? Or what would be a better way to solve this?

Only the first occurrence of a placeholder is replaced

Problem

I have a workflow where I need to update a CHANGELOG.md file, which in contrast to the releases page will not automatically generate links for the PRs and authors.
This means I have to manually create the links:

"pr_template": "- ${{TITLE}} ([#${{NUMBER}}](${{URL}})) [@${{AUTHOR}}](https://github.com/${{AUTHOR}})"

For the PR it works fine because there is a placeholder for the PR URL, but that is not the case for the author, this forces me to use the AUTHOR placeholder twice, however with the current implementation only the first occurrence of the placeholder is replaced.

Solution

There are two possible solutions:

  • Use the replaceAll method instead of the current replace.
  • Create a new placeholder named AUTHOR_URL or something similar that is replaced with a link to the profile of the PR author.

Feature request: ability to add labels to matched PRs

This action is really great, it's made generating our change logs super easy.

One thing we want to be able to do is label PRs which have gone into a release with the release version they made it into. I could definitely see the argument of scope creep, but given that this action already has that complete list of PRs, it would be really useful if they could be labelled following change log generation.

Can't access config.json

Hi, I noticed that when the workflow job is running is dosen't checkout my repo...
I tried using actions/checkout@v2, but I got an error.

Heres my .myl:

name: Create Release

on:
  push:
    branches:
      - master
    tags:
      - 'v*'

jobs:
  release:

    runs-on: ubuntu-latest

    steps:
      - name: Generate changelog
        id: Changelog
        uses: mikepenz/release-changelog-builder-action@main
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          outputFile: 'CHANGELOG.md'
          configuration: '.github/config_release_changelog.json'

      - name: Run check
        run: ls -a

      - name: Create release
        uses: actions/create-release@latest
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: ${{ github.ref }}
          release_name: ${{ github.ref }}
          body: ${{ steps.Changelog.outputs.changelog }}
          draft: 'true'
          prerelease: 'true'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.