From 6953ae6e9cbaa1cdaa138515b6ffc6782b4f8e40 Mon Sep 17 00:00:00 2001 From: Jirka Borovec <6035284+borda@users.noreply.github.com> Date: Thu, 27 Apr 2023 16:15:08 +0200 Subject: [PATCH] ci: label issue with version (#17484) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> (cherry picked from commit 3a01abbde333ec4ecba5208aa1c426b52173fa9e) --- .github/ISSUE_TEMPLATE/1_bug_report.yaml | 15 ++++++++ .github/workflows/labeler-issue.yml | 35 +++++++++++++++++++ .../workflows/{labeler.yml => labeler-pr.yml} | 4 +-- 3 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/labeler-issue.yml rename .github/workflows/{labeler.yml => labeler-pr.yml} (76%) diff --git a/.github/ISSUE_TEMPLATE/1_bug_report.yaml b/.github/ISSUE_TEMPLATE/1_bug_report.yaml index b8a394453be1a..7b98f0a557489 100644 --- a/.github/ISSUE_TEMPLATE/1_bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/1_bug_report.yaml @@ -26,6 +26,21 @@ body: validations: required: true + - type: dropdown + id: versions + attributes: + label: What version are you seeing the problem on? + id: versions + description: select all version where you have experienced this issue + multiple: true + options: + - "ver: 1.6.x" + - "ver: 1.7.x" + - "ver: 1.8.x" + - "ver: 1.9.x" + - "ver: 2.0.x" + - "ver: master" + - type: markdown attributes: value: "**Note: The rest of this form is optional, but filling it out may help us to provide better support.**" diff --git a/.github/workflows/labeler-issue.yml b/.github/workflows/labeler-issue.yml new file mode 100644 index 0000000000000..b28eb987dc46a --- /dev/null +++ b/.github/workflows/labeler-issue.yml @@ -0,0 +1,35 @@ +name: Label Issue +on: + issues: + types: [opened, edited] + +permissions: + contents: read + +jobs: + label-component: + runs-on: ubuntu-latest + + permissions: + # required for all workflows + issues: write + + # only required for workflows in private repositories + actions: read + contents: read + + steps: + - uses: actions/checkout@v3 + + - name: Parse issue form + uses: stefanbuck/github-issue-parser@v3 + id: issue-parser + with: + template-path: .github/ISSUE_TEMPLATE/1_bug_report.yaml + + - name: Set labels based on severity field + uses: redhat-plumbers-in-action/advanced-issue-labeler@v2 + with: + issue-form: ${{ steps.issue-parser.outputs.jsonString }} + section: versions + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler-pr.yml similarity index 76% rename from .github/workflows/labeler.yml rename to .github/workflows/labeler-pr.yml index 11cd619105e8e..e67d7e3e83943 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler-pr.yml @@ -1,6 +1,5 @@ name: Label Pull Requests -on: - - pull_request_target +on: [pull_request_target] jobs: triage: @@ -12,3 +11,4 @@ jobs: - uses: actions/labeler@v4 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" + configuration-path: .github/labeler.yml