release-drafter: Error applying minor version label

Got an error when the workflow had a minor label applied

Screen Shot 2022-01-13 at 12 13 55 PM

name: Draft Release
on:
    push:
        branches:
            - main
        pull_request:
            types: [opened, reopened, synchronize]

jobs:
    update_release_draft:
        runs-on: ubuntu-latest
        steps:
            - uses: release-drafter/release-drafter@v5
              with:
                  config-name: release-template.yml
              #   disable-autolabeler: true
              env:
                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

name-template: '$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'
categories:
    - title: "๐Ÿš€ What's new"
      labels:
          - 'PR: New'
    - title: '๐Ÿ‹๏ธ Improvements'
      labels:
          - 'PR: Improvement'
    - title: '๐Ÿ› Bug Fixes'
      labels:
          - 'PR: Fix'
exclude-labels:
    - 'PR: No Changelog'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
    minor:
        labels:
            - 'minor'
    patch:
        labels:
            - 'patch'
    default: patch
template: |
    ## Release Changes

    $CHANGES

I have a general question to. If we add a minor label to multiple PRs will it continuously bump the version number? Or is it only one bump per release? Thanks

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (10 by maintainers)

Most upvoted comments

Just want to drop a quick note here to say that our repos that use release-drafter/release-drafter@v5 have started to get what seems to be the same error:

  stack: 'AggregateError: \n' +
    "    TypeError: Cannot read properties of undefined (reading 'labels')\n" +
    '        at /home/runner/work/_actions/release-drafter/release-drafter/v5/dist/index.js:133627:41\n' +
    '        at Array.flatMap (<anonymous>)\n' +
    '        at resolveVersionKeyIncrement (/home/runner/work/_actions/release-drafter/release-drafter/v5/dist/index.js:133626:8)\n' +
    '        at generateReleaseInfo (/home/runner/work/_actions/release-drafter/release-drafter/v5/dist/index.js:133678:5)\n' +
    '        at drafter (/home/runner/work/_actions/release-drafter/release-drafter/v5/dist/index.js:132984:25)\n' +
    '        at async Promise.all (index 0)\n' +
    '    at /home/runner/work/_actions/release-drafter/release-drafter/v5/dist/index.js:16687:19',

and we are not using a โ€œminorโ€ label, so that detail is probably not central to the breakage.

I have restored things to working order in a repo by locking the version to 5.15.0 so one of the two recent releases must have broken this.

For those who want to use this workaround, hereโ€™s what I did:

I changed

        uses: release-drafter/release-drafter@v5

to

        uses: release-drafter/release-drafter@v5.15.0

and on my next merge to my main branch all worked as expected.

(heads up @KevinBatdorf in case this helps you)

Nah, the default config ensure our code base works as expected on objects without too much conditional code logic ๐Ÿ˜ƒ

See #1012

@KevinBatdorf if you add a major section to your version-resolver I suspect it will work.

I believe it is #973 it is not performing a deep merge of the defaults. So it should have defaulted to version-resolver: { major: labels: [], }

I have a general question to. If we add a minor label to multiple PRs will it continuously bump the version number? Or is it only one bump per release? Thanks

We only do a single increment.