From 4e2a8505ba3545647ce98c3cb2bb7e0e095ce581 Mon Sep 17 00:00:00 2001 From: totoprayogo1916 Date: Wed, 18 Jan 2023 05:42:12 +0700 Subject: [PATCH] update close-pull-request.yml - add types for pull_request_target - add permission - use GitHub CLI --- .../.github/workflows/close-pull-request.yml | 14 ++++++++++---- .../.github/workflows/close-pull-request.yml | 14 ++++++++++---- .../.github/workflows/close-pull-request.yml | 14 ++++++++++---- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/admin/framework/.github/workflows/close-pull-request.yml b/admin/framework/.github/workflows/close-pull-request.yml index 4e01f30f5138..7106224836f6 100644 --- a/admin/framework/.github/workflows/close-pull-request.yml +++ b/admin/framework/.github/workflows/close-pull-request.yml @@ -2,17 +2,23 @@ name: Close Pull Request on: pull_request_target: - types: [opened] + types: [opened, reopened] + +permissions: + pull-requests: write jobs: main: runs-on: ubuntu-latest steps: - name: Close PR with nice message - uses: superbrothers/close-pull-request@v3 - with: - comment: > + run: gh pr close ${{ env.ISSUE }} -c "${{ env.COMMENT }}" + working-directory: ${{ github.workspace }} + env: + COMMENT: > Thank you for your pull request. However, you have submitted your PR on a read-only split of `codeigniter4/CodeIgniter4`. This repository, unfortunately, does not accept PRs. Please submit your PR at https://github.com/codeigniter4/CodeIgniter4 repository.

Thank you. + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ISSUE: ${{ github.event.pull_request.html_url }} diff --git a/admin/starter/.github/workflows/close-pull-request.yml b/admin/starter/.github/workflows/close-pull-request.yml index 4e01f30f5138..7106224836f6 100644 --- a/admin/starter/.github/workflows/close-pull-request.yml +++ b/admin/starter/.github/workflows/close-pull-request.yml @@ -2,17 +2,23 @@ name: Close Pull Request on: pull_request_target: - types: [opened] + types: [opened, reopened] + +permissions: + pull-requests: write jobs: main: runs-on: ubuntu-latest steps: - name: Close PR with nice message - uses: superbrothers/close-pull-request@v3 - with: - comment: > + run: gh pr close ${{ env.ISSUE }} -c "${{ env.COMMENT }}" + working-directory: ${{ github.workspace }} + env: + COMMENT: > Thank you for your pull request. However, you have submitted your PR on a read-only split of `codeigniter4/CodeIgniter4`. This repository, unfortunately, does not accept PRs. Please submit your PR at https://github.com/codeigniter4/CodeIgniter4 repository.

Thank you. + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ISSUE: ${{ github.event.pull_request.html_url }} diff --git a/admin/userguide/.github/workflows/close-pull-request.yml b/admin/userguide/.github/workflows/close-pull-request.yml index 4e01f30f5138..7106224836f6 100644 --- a/admin/userguide/.github/workflows/close-pull-request.yml +++ b/admin/userguide/.github/workflows/close-pull-request.yml @@ -2,17 +2,23 @@ name: Close Pull Request on: pull_request_target: - types: [opened] + types: [opened, reopened] + +permissions: + pull-requests: write jobs: main: runs-on: ubuntu-latest steps: - name: Close PR with nice message - uses: superbrothers/close-pull-request@v3 - with: - comment: > + run: gh pr close ${{ env.ISSUE }} -c "${{ env.COMMENT }}" + working-directory: ${{ github.workspace }} + env: + COMMENT: > Thank you for your pull request. However, you have submitted your PR on a read-only split of `codeigniter4/CodeIgniter4`. This repository, unfortunately, does not accept PRs. Please submit your PR at https://github.com/codeigniter4/CodeIgniter4 repository.

Thank you. + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ISSUE: ${{ github.event.pull_request.html_url }}