From 8f6b526b47cd406f86f7c90bfcdf588e953268f7 Mon Sep 17 00:00:00 2001 From: Michael Adkins Date: Fri, 27 Jan 2023 12:12:20 -0600 Subject: [PATCH 1/2] Update issue label workflow --- .github/workflows/issue-bot.yaml | 33 ++++++++++++++++++++++ .github/workflows/remove-issue-labels.yaml | 14 --------- 2 files changed, 33 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/issue-bot.yaml delete mode 100644 .github/workflows/remove-issue-labels.yaml diff --git a/.github/workflows/issue-bot.yaml b/.github/workflows/issue-bot.yaml new file mode 100644 index 000000000000..c55ad0c7c70c --- /dev/null +++ b/.github/workflows/issue-bot.yaml @@ -0,0 +1,33 @@ +name: Issue bot + +on: + issues: + types: [closed, assigned, unassigned] + +jobs: + remove_label: + runs-on: ubuntu-latest + steps: + - name: Remove triage label on close + if: github.event.action == 'closed' + run: gh issue edit --repo prefecthq/prefect ${{ github.event.issue.number }} --remove-label "status:triage" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Update issue status when assigned + if: github.event.action == 'assigned' + run: gh issue edit --repo prefecthq/prefect ${{ github.event.issue.number }} --add-label "status:in-progress" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Update issue status when unassigned + if: github.event.action == 'unassigned' + run: gh issue edit --repo prefecthq/prefect ${{ github.event.issue.number }} --remove-label "status:in-progress" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Remove triage label on status change + if: github.event.action == 'labeled' && startsWith(github.event.label.name, "status:") && github.event.label.name != "status:triage" + run: gh issue edit --repo prefecthq/prefect ${{ github.event.issue.number }} --remove-label "status:triage" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/remove-issue-labels.yaml b/.github/workflows/remove-issue-labels.yaml deleted file mode 100644 index 0cbb815d3bf5..000000000000 --- a/.github/workflows/remove-issue-labels.yaml +++ /dev/null @@ -1,14 +0,0 @@ -name: Remove Labels - -on: - issues: - types: [closed] - -jobs: - remove_label: - runs-on: ubuntu-latest - steps: - - name: Remove label - run: gh issue edit ${{ github.event.issue.number }} --remove-label "status:triage" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From a0eec4024d9bf83deb061da8236dbb09cd3c4af0 Mon Sep 17 00:00:00 2001 From: Michael Adkins Date: Fri, 27 Jan 2023 12:57:52 -0600 Subject: [PATCH 2/2] Add "labeled" trigger --- .github/workflows/issue-bot.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/issue-bot.yaml b/.github/workflows/issue-bot.yaml index c55ad0c7c70c..17de3f5d521f 100644 --- a/.github/workflows/issue-bot.yaml +++ b/.github/workflows/issue-bot.yaml @@ -2,7 +2,7 @@ name: Issue bot on: issues: - types: [closed, assigned, unassigned] + types: [closed, assigned, unassigned, labeled] jobs: remove_label: