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

Set issue labels based on conditions in issue form #27676

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

JakobDev
Copy link
Contributor

This PR allows issue forms to set labels, based on what the user selects. Take for example this form:

name: Bug Report
about: File a bug report
body:
  - type: dropdown
    id: os
    attributes:
      label: Operating System
      description: What OS are you using?
      options:
        - Windows
        - macOS
        - Linux
      options_labels:
        Windows: ["OS/Windows"]
        macOS: ["OS/Mac"]
        Linux: ["OS/Linux"]
  - type: checkboxes
    id: lts
    attributes:
      label: LTS
      options:
        - label: This Bug also affects the LTS version
          labels: [LTS]

If Windows is selected, the issue gets the OS/Windows label, with macOS it gets the OS/Mac label and with Linux the OS/Linux label. When the checkbox is checked, the issue gets the LTS label. This can save some work.

This is missing.

  • Validation
  • Tests
  • Documentation

I first want some feed back of this new feature before tackling any of this.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 18, 2023
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 18, 2023
@delvh
Copy link
Member

delvh commented Oct 18, 2023

I can foresee problems when an option contains whitespace.
Is there any workaround for that, i.e. quoting the key?

@JakobDev
Copy link
Contributor Author

I can foresee problems when an option contains whitespace.

YAML allows whitespaces in keys. Quoting of keys is also allowed, so there is no problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants