diff --git a/.github/workflows/assign-to-project.yml b/.github/workflows/assign-to-project.yml new file mode 100644 index 0000000000000..4c31e1b09d5b8 --- /dev/null +++ b/.github/workflows/assign-to-project.yml @@ -0,0 +1,39 @@ +name: Assign to 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 Project + steps: + - name: Assign NEW issues to Docs SIG project + uses: srggrs/assign-one-project-github-action@1.2.0 + if: | + github.event_name == 'issues' && + github.event.action == 'opened' + with: + project: 'https://github.com/pingcap/docs/projects/1' + column_name: 'Issue: Backlog' + - name: Assign NEW pull requests to Docs SIG project + uses: srggrs/assign-one-project-github-action@1.2.0 + if: | + github.event_name == 'pull_request' && + github.event.action == 'opened' + with: + project: 'https://github.com/pingcap/docs/projects/1' + column_name: 'PR: In Progress' + - name: Assign issues or PRs with translation-welcome label + uses: srggrs/assign-one-project-github-action@1.2.0 + if: | + contains(github.event.issue.labels.*.name, 'translation/welcome') || + contains(github.event.pull_request.labels.*.name, 'translation/welcome') + with: + project: 'https://github.com/pingcap/docs/projects/2' + column_name: 'To do' diff --git a/.github/workflows/assign_sig_project.yml b/.github/workflows/assign_sig_project.yml deleted file mode 100644 index d73dc28d5e752..0000000000000 --- a/.github/workflows/assign_sig_project.yml +++ /dev/null @@ -1,52 +0,0 @@ -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'