diff --git a/.github/workflows/label-new-issues.yaml b/.github/workflows/label-new-issues.yaml new file mode 100644 index 0000000..c7fcb21 --- /dev/null +++ b/.github/workflows/label-new-issues.yaml @@ -0,0 +1,18 @@ +--- +name: label new issues +on: + issues: + types: + - opened + - reopened + +jobs: + add_label: + runs-on: ubuntu-latest + permissions: + contents: write + issues: write + steps: + - uses: actions-ecosystem/action-add-labels@v1 + with: + labels: needs_triage diff --git a/.github/workflows/label-new-prs.yaml b/.github/workflows/label-new-prs.yaml new file mode 100644 index 0000000..8db1dd9 --- /dev/null +++ b/.github/workflows/label-new-prs.yaml @@ -0,0 +1,27 @@ +--- +name: label new prs +on: + pull_request_target: + types: + - opened + - reopened + - converted_to_draft + - ready_for_review + +jobs: + add_label: + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: Add 'needs_triage' label if the pr is not a draft + uses: actions-ecosystem/action-add-labels@v1 + if: github.event.pull_request.draft == false + with: + labels: needs_triage + + - name: Remove 'needs_triage' label if the pr is a draft + uses: actions-ecosystem/action-remove-labels@v1 + if: github.event.pull_request.draft == true + with: + labels: needs_triage