From 5abaf8cdf4e549dd041e3196328b5afee9c7d072 Mon Sep 17 00:00:00 2001 From: Aman Shrivastava Date: Wed, 19 Mar 2025 14:06:30 +0530 Subject: [PATCH] added dropdown in OS field of the bug-report issue form and github workflow to auto lable (#11880) --- .github/ISSUE_TEMPLATE/bug-report.yaml | 28 ++++++++++++++++++++-- .github/workflows/auto-label-os.yml | 32 ++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/auto-label-os.yml diff --git a/.github/ISSUE_TEMPLATE/bug-report.yaml b/.github/ISSUE_TEMPLATE/bug-report.yaml index 7c308b001..107deb004 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yaml +++ b/.github/ISSUE_TEMPLATE/bug-report.yaml @@ -36,11 +36,35 @@ body: attributes: value: '### Environment' - - type: textarea + - type: dropdown id: os attributes: label: OS - placeholder: 'printf "$(uname -srm)\n$(cat /etc/os-release)\n"' + options: + - 'RHEL 9' + - 'RHEL 8' + - 'Fedora 40' + - 'Ubuntu 24' + - 'Ubuntu 22' + - 'Ubuntu 20' + - 'Debian 12' + - 'Debian 11' + - 'Flatcar Container Linux' + - 'openSUSE Leap' + - 'openSUSE Tumbleweed' + - 'Oracle Linux 9' + - 'Oracle Linux 8' + - 'AlmaLinux 9' + - 'AlmaLinux 8' + - 'Rocky Linux 9' + - 'Rocky Linux 8' + - 'Amazon Linux 2' + - 'Kylin Linux Advanced Server V10' + - 'UOS Linux 20' + - 'openEuler 24' + - 'openEuler 22' + - 'openEuler 20' + - 'Other|Unsupported' validations: required: true diff --git a/.github/workflows/auto-label-os.yml b/.github/workflows/auto-label-os.yml new file mode 100644 index 000000000..86c8ee123 --- /dev/null +++ b/.github/workflows/auto-label-os.yml @@ -0,0 +1,32 @@ +name: Issue labeler +on: + issues: + types: [opened] + +permissions: + contents: read + +jobs: + label-component: + runs-on: ubuntu-latest + permissions: + issues: write + + steps: + - uses: actions/checkout@v3 + + - name: Parse issue form + uses: stefanbuck/github-issue-parser@v3 + id: issue-parser + with: + template-path: .github/ISSUE_TEMPLATE/bug-report.yaml + + - name: Set labels based on OS field + uses: redhat-plumbers-in-action/advanced-issue-labeler@v2 + with: + issue-form: ${{ steps.issue-parser.outputs.jsonString }} + section: os + block-list: | + None + Other + token: ${{ secrets.GITHUB_TOKEN }}