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

Allow to define category order/priority #551

Closed
mvorisek opened this issue Jun 1, 2020 · 8 comments · Fixed by #1013
Closed

Allow to define category order/priority #551

mvorisek opened this issue Jun 1, 2020 · 8 comments · Fixed by #1013

Comments

@mvorisek
Copy link

mvorisek commented Jun 1, 2020

This is a feature request to allow to set the category order/priority.

Very important to be able to move more important categories like "Breaking Changes" to the top of the changelog.

@jetersen
Copy link
Member

jetersen commented Jun 1, 2020

That is done by ordering your categories.

Put the breaking category on top :)

categories:
- title: 'Breaking'
label: 'type: breaking'
- title: 'New'
label: 'type: feature'
- title: 'Bug Fixes'
label: 'type: bug'
- title: 'Maintenance'
label: 'type: maintenance'
- title: 'Documentation'
label: 'type: docs'
- title: 'Dependency Updates'
label: 'type: dependencies'

@mvorisek
Copy link
Author

mvorisek commented Jun 1, 2020

That is done by ordering your categories.

Put the breaking category on top :)

That was the first idea that came to my mind, but ir does not work, see:
https://github.com/atk4/data/releases
https://github.com/atk4/data/blob/develop/.github/release-drafter.yml

It seems the uncategorized PRs are moved to the top instead of to the bottom as I would expect

@jetersen
Copy link
Member

jetersen commented Jun 1, 2020

Yes uncategorized PRs are at the top.
I guess what your asking for is #139

@mvorisek
Copy link
Author

mvorisek commented Jun 1, 2020

Yes, exactly #139 (comment)

Do you think this can be fixed soon and is there currently any workaround like specifying "other/unmatched labels"?

@jetersen
Copy link
Member

jetersen commented Jun 1, 2020

You know you can just copy and paste? That's a quick workaround 😆

@alfieyfc
Copy link

For a workaround that utilizes actions to automate this, I run this job on PR creation:

    steps:
      # Label PR by head branch's name
      - name: Auto Labeler
        uses: TimonVS/pr-labeler-action@v3
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      # Get length of labels array 
      - name: Get Labels
        id: get-label-arr
        run: |
          export LENGTH=$(curl -k https://api.github.com/repos/$GITHUB_REPOSITORY/pulls/${{ github.event.pull_request.number }} | jq '.labels | length')
          echo "::set-output name=length::$(echo $LENGTH)"
      # Label misc if no label was applied
      - name: Label Misc
        if: ${{ steps.get-label-arr.outputs.length == 0 }}
        uses: buildsville/add-remove-label@v1
        with:
          token: ${{secrets.GITHUB_TOKEN}}
          label: "type: misc"
          type: add

and put type: misc in the category at the bottom.

# release-drafter.yml 
categories:
  - title: 🚀 Features
    label: feature
  - title: 🐛 Bug Fixes
    label: fix
  - title: Misc.
    label: "type: misc"
template: |
  $CHANGES

I guess there's a better way to inspect labeled labels than just checking the length of labels array, but this was probably already an overkill for a workaround and it fits my scenario for now so I'm just gonna stick with it 😆

@jetersen
Copy link
Member

created #1013

@mvorisek
Copy link
Author

thank you ❤️

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

Successfully merging a pull request may close this issue.

3 participants