From 310f4927839bf1ce1fc7e4545605a9e4fda7a32e Mon Sep 17 00:00:00 2001 From: Ran Date: Wed, 20 May 2020 15:18:21 +0800 Subject: [PATCH 1/4] .github: add a yml to auto assign new PRs and issues to sig project --- .github/workflows/assign_sig_project.yml | 20 ++++++++++++++++++++ 1 file changed, 20 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..3c4fbf77d883e --- /dev/null +++ b/.github/workflows/assign_sig_project.yml @@ -0,0 +1,20 @@ +name: Auto Assign to Docs SIG Project + +on: + issues: + types: [opened, labeled] + pull_request: + types: [opened, labeled] +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + assign_one_project: + runs-on: ubuntu-latest + name: Assign to Docs SIG Project + steps: + - name: Assign NEW issues and NEW pull requests to Docs SIG Project + uses: srggrs/assign-one-project-github-action@1.2.0 + if: github.event.action == 'opened' + with: + project: 'https://github.com/pingcap/docs/projects/1' From 55c53a9330dd7ebd174ace36a0c74df8b6613950 Mon Sep 17 00:00:00 2001 From: Ran Date: Wed, 20 May 2020 16:20:37 +0800 Subject: [PATCH 2/4] assign translation/welcome pr to related column --- .github/workflows/assign_sig_project.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/assign_sig_project.yml b/.github/workflows/assign_sig_project.yml index 3c4fbf77d883e..230ca2e4590c0 100644 --- a/.github/workflows/assign_sig_project.yml +++ b/.github/workflows/assign_sig_project.yml @@ -1,4 +1,4 @@ -name: Auto Assign to Docs SIG Project +name: Auto Assign to Project on: issues: @@ -13,8 +13,15 @@ jobs: runs-on: ubuntu-latest name: Assign to Docs SIG Project steps: - - name: Assign NEW issues and NEW pull requests to Docs SIG Project + - name: Assign to Docs SIG Project uses: srggrs/assign-one-project-github-action@1.2.0 if: github.event.action == 'opened' with: project: 'https://github.com/pingcap/docs/projects/1' + - name: Assign to Translation/Welcome Column + 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' From 01748eee3bd63519fba395d1c3bce08033275eb2 Mon Sep 17 00:00:00 2001 From: Ran Date: Wed, 20 May 2020 16:57:15 +0800 Subject: [PATCH 3/4] update actions for 5 columns --- .github/workflows/assign_sig_project.yml | 33 ++++++++++++++++++++---- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/.github/workflows/assign_sig_project.yml b/.github/workflows/assign_sig_project.yml index 230ca2e4590c0..df76bedc46c43 100644 --- a/.github/workflows/assign_sig_project.yml +++ b/.github/workflows/assign_sig_project.yml @@ -2,9 +2,9 @@ name: Auto Assign to Project on: issues: - types: [opened, labeled] + types: [opened, labeled, closed] pull_request: - types: [opened, labeled] + types: [opened, labeled, closed] env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -13,12 +13,35 @@ jobs: runs-on: ubuntu-latest name: Assign to Docs SIG Project steps: - - name: Assign to Docs SIG Project + - name: Assign Open Issue uses: srggrs/assign-one-project-github-action@1.2.0 - if: github.event.action == 'opened' + 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' with: project: 'https://github.com/pingcap/docs/projects/1' - - name: Assign to Translation/Welcome Column + 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') From c5e44d982a7153fd4ca9f5c749a7170a11653d3b Mon Sep 17 00:00:00 2001 From: Ran Date: Wed, 20 May 2020 17:08:33 +0800 Subject: [PATCH 4/4] add unlabeled as a trigger --- .github/workflows/assign_sig_project.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/assign_sig_project.yml b/.github/workflows/assign_sig_project.yml index df76bedc46c43..d73dc28d5e752 100644 --- a/.github/workflows/assign_sig_project.yml +++ b/.github/workflows/assign_sig_project.yml @@ -4,7 +4,7 @@ on: issues: types: [opened, labeled, closed] pull_request: - types: [opened, labeled, closed] + types: [opened, labeled, unlabeled, closed] env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -37,7 +37,9 @@ jobs: - name: Assign Closed PR uses: srggrs/assign-one-project-github-action@1.2.0 if: | - github.event.action == 'closed' && github.event = 'pull_request' + 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'