From 42c0ca355364270afb2f511a85b0d2d375256915 Mon Sep 17 00:00:00 2001 From: Ivan De Marino Date: Tue, 8 Mar 2022 16:22:19 +0000 Subject: [PATCH] GH Action to link incoming issues and pull-requests to the Terraform DevEx Team board --- .github/workflows/add-content-to-project.yml | 37 ++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/add-content-to-project.yml diff --git a/.github/workflows/add-content-to-project.yml b/.github/workflows/add-content-to-project.yml new file mode 100644 index 00000000..908d06b1 --- /dev/null +++ b/.github/workflows/add-content-to-project.yml @@ -0,0 +1,37 @@ +# Based on https://github.com/leonsteinhaeuser/project-beta-automations + +name: "Add Issues/PRs to TF Provider DevEx team board" + +on: + issues: + types: [opened, reopened] + pull_request: + # NOTE: The way content is added to project board is equivalent to an "upsert". + # Calling it multiple times will be idempotent. + types: [opened, reopened, ready_for_review] + +jobs: + add-content-to-project: + name: "Add Content to project" + runs-on: ubuntu-latest + steps: + - name: "Set Issue to 'Priority = Triage Next'" + uses: leonsteinhaeuser/project-beta-automations@v1.2.1 + if: github.event_name == 'issues' + with: + gh_token: ${{ secrets.TF_DEVEX_PROJECT_GITHUB_TOKEN }} + organization: "hashicorp" + project_id: 99 #< https://github.com/orgs/hashicorp/projects/99 + resource_node_id: ${{ github.event.issue.node_id }} + operation_mode: custom_field + custom_field_values: '[{\"name\":\"Priority\",\"type\":\"single_select\",\"value\":\"Triage Next\"}]' + - name: "Set Pull Request to 'Priority = Triage Next'" + uses: leonsteinhaeuser/project-beta-automations@v1.2.1 + if: github.event_name == 'pull_request' + with: + gh_token: ${{ secrets.TF_DEVEX_PROJECT_GITHUB_TOKEN }} + organization: "hashicorp" + project_id: 99 #< https://github.com/orgs/hashicorp/projects/99 + resource_node_id: ${{ github.event.pull_request.node_id }} + operation_mode: custom_field + custom_field_values: '[{\"name\":\"Priority\",\"type\":\"single_select\",\"value\":\"Triage Next\"}]'