From 8be1d4656938dd267b2baf89cb4250b66e1d57cf Mon Sep 17 00:00:00 2001 From: powe97 <116031952+powe97@users.noreply.github.com> Date: Mon, 12 Aug 2024 14:43:22 -0400 Subject: [PATCH] Auto add to project --- .github/workflows/add_to_project.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/add_to_project.yml diff --git a/.github/workflows/add_to_project.yml b/.github/workflows/add_to_project.yml new file mode 100644 index 0000000..6ae2570 --- /dev/null +++ b/.github/workflows/add_to_project.yml @@ -0,0 +1,25 @@ +name: "Add PR to project board" +on: + pull_request_target: + types: + - opened + +env: + PR_URL: ${{ github.event.pull_request.html_url }} + +jobs: + title-check: + runs-on: ubuntu-latest + steps: + - name: Generate token + id: generate-token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ vars.APP_ID }} + private-key: ${{ secrets.APP_PEM }} + + - name: Add PR to project + env: + GH_TOKEN: ${{ steps.generate-token.outputs.token }} + run: | + gh project item-add --owner Submitty 1 --url "$PR_URL"