Add kanban automation for new pull requests

So now, newly opened pull requests will automatically be added to the
"Reviewing" column, while newly opened draft pull requests will
automatically be added to the "Doing" column.

I've added the "reopened" event just in case (and was indeed very useful
while testing this feature), although we rarely reopen pull requests.

Note that this only works on pull requests that aren't already in the
project; that is, if a pull request is already in the "Doing" column,
closing it and reopening it will *not* move it to the "Reviewing
column".

So it looks like we won't easily be able to extend this feature in order
to automatically move pull requests when they're marked as ready for
review.
This commit is contained in:
Javi Martín
2022-06-08 14:35:16 +02:00
parent 494f1de80b
commit 7015f41e3a

25
.github/workflows/kanban.yml vendored Normal file
View File

@@ -0,0 +1,25 @@
name: Assign new pull requests
on:
pull_request_target:
types: [opened, reopened]
env:
MY_GITHUB_TOKEN: ${{ secrets.KANBAN_TOKEN }}
jobs:
assign_one_project:
runs-on: ubuntu-latest
name: Assign new pull requests
steps:
- name: Assign new pull requests to the reviewing column
uses: srggrs/assign-one-project-github-action@1.3.1
if: github.event.pull_request.draft == false
with:
project: "https://github.com/orgs/consul/projects/1"
column_name: "Reviewing"
- name: Assign new draft pull requests to the doing column
uses: srggrs/assign-one-project-github-action@1.3.1
if: github.event.pull_request.draft == true
with:
project: "https://github.com/orgs/consul/projects/1"
column_name: "Doing"