diff --git a/.github/workflows/closing_ticket.yml b/.github/workflows/closing_ticket.yml new file mode 100644 index 00000000..ef8f6dc5 --- /dev/null +++ b/.github/workflows/closing_ticket.yml @@ -0,0 +1,15 @@ +name: Closing ticket +on: + issues: + types: [closed] +jobs: + label_issues: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - run: 'gh issue edit "$NUMBER" --add-label "status: done" --remove-label "status: wip,status: todo,status: in progress,status: in test,status: not prioritized,status: blocked,status: api review,status: code review,status: design review,status: code complete,status: ready"' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + NUMBER: ${{ github.event.issue.number }} diff --git a/.github/workflows/labeling_ticket_done.yml b/.github/workflows/labeling_ticket_done.yml new file mode 100644 index 00000000..33373932 --- /dev/null +++ b/.github/workflows/labeling_ticket_done.yml @@ -0,0 +1,17 @@ +name: Labeling ticket "Done" +on: + issues: + types: [labeled] +jobs: + label_issues: + runs-on: ubuntu-latest + if: | + contains(github.event.issue.labels.*.name, 'status: done') + permissions: + issues: write + steps: + - run: 'gh issue close "$NUMBER"' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + NUMBER: ${{ github.event.issue.number }} diff --git a/.github/workflows/labeling_ticket_todo.yml b/.github/workflows/labeling_ticket_todo.yml new file mode 100644 index 00000000..982b27fd --- /dev/null +++ b/.github/workflows/labeling_ticket_todo.yml @@ -0,0 +1,17 @@ +name: Labeling ticket "To Do" +on: + issues: + types: [labeled] +jobs: + label_issues: + runs-on: ubuntu-latest + if: | + !contains(github.event.issue.labels.*.name, 'status: done') + permissions: + issues: write + steps: + - run: 'gh issue reopen "$NUMBER"' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + NUMBER: ${{ github.event.issue.number }} diff --git a/.github/workflows/reopening_ticket.yml b/.github/workflows/reopening_ticket.yml new file mode 100644 index 00000000..d64e9914 --- /dev/null +++ b/.github/workflows/reopening_ticket.yml @@ -0,0 +1,15 @@ +name: Reopening ticket +on: + issues: + types: [reopened] +jobs: + label_issues: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - run: 'gh issue edit "$NUMBER" --add-label "status: todo" --remove-label "status: wip,status: done,status: in progress,status: in test,status: not prioritized,status: blocked,status: api review,status: code review,status: design review,status: code complete,status: ready"' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + NUMBER: ${{ github.event.issue.number }}