From 1907d489a4ce3de83c8dacc5f529daf8d09ea96a Mon Sep 17 00:00:00 2001 From: Sam Horvath Date: Tue, 14 Jan 2025 12:09:55 -0500 Subject: [PATCH] ENH: Add automatic labeling of issues --- .github/ISSUE_TEMPLATE/project.yml | 7 +++--- .github/workflows/issue-labeler.yml | 36 +++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/issue-labeler.yml diff --git a/.github/ISSUE_TEMPLATE/project.yml b/.github/ISSUE_TEMPLATE/project.yml index 2a1e3751a..b23b6b4f4 100644 --- a/.github/ISSUE_TEMPLATE/project.yml +++ b/.github/ISSUE_TEMPLATE/project.yml @@ -8,19 +8,20 @@ assignees: body: - type: dropdown + id: draft-status attributes: label: Draft Status description: Select whether the project is ready to be created once this issue is submitted. options: - - Ready - team will start page creating immediately - - Draft - team will hold off on page creation + - ready + - draft validations: required: true - type: markdown attributes: value: | - _Please enter a project name in the title bar above this text. Format: "Project: Project Name"._ + _Please enter a project name in the title bar above this text. Avoid special characters and parentheses. Format: "Project: Project Name"._ - type: dropdown attributes: diff --git a/.github/workflows/issue-labeler.yml b/.github/workflows/issue-labeler.yml new file mode 100644 index 000000000..6fc1ec33f --- /dev/null +++ b/.github/workflows/issue-labeler.yml @@ -0,0 +1,36 @@ +name: Issue labeler +on: + issues: + types: [ opened ] + +permissions: + contents: read + +jobs: + label-component: + if: github.event.label.name == 'project' + runs-on: ubuntu-latest + + permissions: + # required for all workflows + 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/project.yml + + - name: Set labels based on draft status field + uses: redhat-plumbers-in-action/advanced-issue-labeler@v2 + with: + issue-form: ${{ steps.issue-parser.outputs.jsonString }} + section: draft-status + block-list: | + None + Other + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file