From 8a9195e4d0fc1dc09f7bc682a1f1e98c467ebc37 Mon Sep 17 00:00:00 2001 From: rarlala Date: Thu, 12 Sep 2024 18:52:18 +0900 Subject: [PATCH 1/4] ci: add pr automation --- .github/workflows/pr-automation.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/pr-automation.yml diff --git a/.github/workflows/pr-automation.yml b/.github/workflows/pr-automation.yml new file mode 100644 index 0000000..6f49ff9 --- /dev/null +++ b/.github/workflows/pr-automation.yml @@ -0,0 +1,27 @@ +name: PR Automation + +on: + pull_request: + types: [opened, edited, reopened] + +jobs: + automate-pr: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install GitHub CLI + run: | + curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /usr/share/keyrings/githubcli-archive-keyring.gpg > /dev/null + echo "deb [arch=amd64 signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null + sudo apt update + sudo apt install gh + + - name: Add reviewers and assignees + run: | + gh pr edit ${{ github.event.pull_request.number }} --reviewer f-lab-jake + gh pr edit ${{ github.event.pull_request.number }} --add-assignee rarlala + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 7b1fa1735a08eddd708b4aeee149023d2955346d Mon Sep 17 00:00:00 2001 From: rarlala Date: Thu, 12 Sep 2024 18:56:44 +0900 Subject: [PATCH 2/4] fix: correct GitHub CLI command flags for adding reviewers --- .github/workflows/pr-automation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-automation.yml b/.github/workflows/pr-automation.yml index 6f49ff9..3a670f0 100644 --- a/.github/workflows/pr-automation.yml +++ b/.github/workflows/pr-automation.yml @@ -21,7 +21,7 @@ jobs: - name: Add reviewers and assignees run: | - gh pr edit ${{ github.event.pull_request.number }} --reviewer f-lab-jake + gh pr edit ${{ github.event.pull_request.number }} --add-reviewer f-lab-jake gh pr edit ${{ github.event.pull_request.number }} --add-assignee rarlala env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 3ad9e9a63714a6035129992ea66923c0fab73d90 Mon Sep 17 00:00:00 2001 From: rarlala Date: Thu, 12 Sep 2024 19:02:43 +0900 Subject: [PATCH 3/4] ci: workflow trigger test --- .github/workflows/pr-automation-test.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/pr-automation-test.yml diff --git a/.github/workflows/pr-automation-test.yml b/.github/workflows/pr-automation-test.yml new file mode 100644 index 0000000..ad8bb28 --- /dev/null +++ b/.github/workflows/pr-automation-test.yml @@ -0,0 +1,19 @@ +name: PR Automation Test + +on: + pull_request: + types: [opened, edited, reopened] + +jobs: + test-job: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Print Hello World + run: echo "Hello World from GitHub Actions" + + - name: Print PR Number + run: echo "PR Number is ${{ github.event.pull_request.number }}" From bd3c79ec1bb90fbf050492d7266546ec1209b2d5 Mon Sep 17 00:00:00 2001 From: rarlala Date: Thu, 12 Sep 2024 19:07:51 +0900 Subject: [PATCH 4/4] ci: remove workflow test file --- .github/workflows/pr-automation-test.yml | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 .github/workflows/pr-automation-test.yml diff --git a/.github/workflows/pr-automation-test.yml b/.github/workflows/pr-automation-test.yml deleted file mode 100644 index ad8bb28..0000000 --- a/.github/workflows/pr-automation-test.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: PR Automation Test - -on: - pull_request: - types: [opened, edited, reopened] - -jobs: - test-job: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Print Hello World - run: echo "Hello World from GitHub Actions" - - - name: Print PR Number - run: echo "PR Number is ${{ github.event.pull_request.number }}"