From 861ad6b52a3649f3fdc9617e13f39e7902bfff6c Mon Sep 17 00:00:00 2001 From: Ran Date: Thu, 21 May 2020 17:49:37 +0800 Subject: [PATCH] .github: add a yml to auto assign new PRs and issues to sig project (#2598) * .github: add a yml to auto assign new PRs and issues to sig project * assign translation/welcome pr to related column * update actions for 5 columns * add unlabeled as a trigger --- .github/workflows/assign_sig_project.yml | 52 ++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/assign_sig_project.yml diff --git a/.github/workflows/assign_sig_project.yml b/.github/workflows/assign_sig_project.yml new file mode 100644 index 0000000000000..d73dc28d5e752 --- /dev/null +++ b/.github/workflows/assign_sig_project.yml @@ -0,0 +1,52 @@ +name: Auto Assign to Project + +on: + issues: + types: [opened, labeled, closed] + pull_request: + types: [opened, labeled, unlabeled, closed] +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + assign_one_project: + runs-on: ubuntu-latest + name: Assign to Docs SIG Project + steps: + - name: Assign Open Issue + uses: srggrs/assign-one-project-github-action@1.2.0 + if: | + github.event.action == 'opened' && github.event = 'issue' + with: + project: 'https://github.com/pingcap/docs/projects/1' + column_name: 'Issue: Backlog' + - name: Assign Closed Issue + uses: srggrs/assign-one-project-github-action@1.2.0 + if: | + github.event.action == 'closed' && github.event = 'issue' + with: + project: 'https://github.com/pingcap/docs/projects/1' + column_name: 'Issue: Resolved' + - name: Assign Open PR + uses: srggrs/assign-one-project-github-action@1.2.0 + if: | + github.event.action == 'opened' && github.event = 'pull_request' + with: + project: 'https://github.com/pingcap/docs/projects/1' + column_name: 'PR: In Progress' + - name: Assign Closed PR + uses: srggrs/assign-one-project-github-action@1.2.0 + if: | + github.event.action == 'closed' && + github.event = 'pull_request' && + ! contains(github.event.pull_request.labels.*.name, 'translation/welcome') + with: + project: 'https://github.com/pingcap/docs/projects/1' + column_name: 'PR: Done' + - name: Assign Translation/Welcome PR + uses: srggrs/assign-one-project-github-action@1.2.0 + if: | + contains(github.event.pull_request.labels.*.name, 'translation/welcome') + with: + project: 'https://github.com/pingcap/docs/projects/1' + column_name: 'Translation/Welcome'