From 9cc83c6fe9264f85dbeccb371ab6235dab69ee33 Mon Sep 17 00:00:00 2001 From: baegteun Date: Thu, 7 Mar 2024 17:52:40 +0900 Subject: [PATCH] =?UTF-8?q?:construction=5Fworker:=20::=20[#433]=20Assign?= =?UTF-8?q?=20=EC=9E=90=EB=8F=99=ED=99=94=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/AutoAssign.yml | 40 ++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/AutoAssign.yml diff --git a/.github/workflows/AutoAssign.yml b/.github/workflows/AutoAssign.yml new file mode 100644 index 000000000..dd580a85b --- /dev/null +++ b/.github/workflows/AutoAssign.yml @@ -0,0 +1,40 @@ +name: Auto assign PR author + +on: + pull_request: + types: + - opened + - reopened + +jobs: + assign-pr-author: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Get PR author + id: get-pr-author + run: echo "author=${{ github.event.pull_request.user.login }}" >> $GITHUB_OUTPUT + + - name: Assign PR author + run: gh pr edit ${{ github.event.number }} --add-assignee ${{ steps.get-pr-author.outputs.author }} + env: + GH_TOKEN: ${{ github.token }} + + - name: Comment success result to PR + uses: mshick/add-pr-comment@v2 + if: ${{ success() }} + with: + message: | + ## ✅ Assign 자동 지정을 성공했어요! + @${{ steps.get-pr-author.outputs.author }} + allow-repeats: true + + - name: Comment failure result to PR + uses: mshick/add-pr-comment@v2 + if: ${{ failure() }} + with: + message: "## ❌ PR의 Assign 자동 지정을 실패했어요." + allow-repeats: true