Skip to content

Commit 4e2a850

Browse files
update close-pull-request.yml
- add types for pull_request_target - add permission - use GitHub CLI
1 parent ed25a2c commit 4e2a850

3 files changed

Lines changed: 30 additions & 12 deletions

File tree

admin/framework/.github/workflows/close-pull-request.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,23 @@ name: Close Pull Request
22

33
on:
44
pull_request_target:
5-
types: [opened]
5+
types: [opened, reopened]
6+
7+
permissions:
8+
pull-requests: write
69

710
jobs:
811
main:
912
runs-on: ubuntu-latest
1013
steps:
1114
- name: Close PR with nice message
12-
uses: superbrothers/close-pull-request@v3
13-
with:
14-
comment: >
15+
run: gh pr close ${{ env.ISSUE }} -c "${{ env.COMMENT }}"
16+
working-directory: ${{ github.workspace }}
17+
env:
18+
COMMENT: >
1519
Thank you for your pull request. However, you have submitted your PR on a read-only
1620
split of `codeigniter4/CodeIgniter4`. This repository, unfortunately, does
1721
not accept PRs. Please submit your PR at https://github.com/codeigniter4/CodeIgniter4
1822
repository.<br/><br/>Thank you.
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
ISSUE: ${{ github.event.pull_request.html_url }}

admin/starter/.github/workflows/close-pull-request.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,23 @@ name: Close Pull Request
22

33
on:
44
pull_request_target:
5-
types: [opened]
5+
types: [opened, reopened]
6+
7+
permissions:
8+
pull-requests: write
69

710
jobs:
811
main:
912
runs-on: ubuntu-latest
1013
steps:
1114
- name: Close PR with nice message
12-
uses: superbrothers/close-pull-request@v3
13-
with:
14-
comment: >
15+
run: gh pr close ${{ env.ISSUE }} -c "${{ env.COMMENT }}"
16+
working-directory: ${{ github.workspace }}
17+
env:
18+
COMMENT: >
1519
Thank you for your pull request. However, you have submitted your PR on a read-only
1620
split of `codeigniter4/CodeIgniter4`. This repository, unfortunately, does
1721
not accept PRs. Please submit your PR at https://github.com/codeigniter4/CodeIgniter4
1822
repository.<br/><br/>Thank you.
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
ISSUE: ${{ github.event.pull_request.html_url }}

admin/userguide/.github/workflows/close-pull-request.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,23 @@ name: Close Pull Request
22

33
on:
44
pull_request_target:
5-
types: [opened]
5+
types: [opened, reopened]
6+
7+
permissions:
8+
pull-requests: write
69

710
jobs:
811
main:
912
runs-on: ubuntu-latest
1013
steps:
1114
- name: Close PR with nice message
12-
uses: superbrothers/close-pull-request@v3
13-
with:
14-
comment: >
15+
run: gh pr close ${{ env.ISSUE }} -c "${{ env.COMMENT }}"
16+
working-directory: ${{ github.workspace }}
17+
env:
18+
COMMENT: >
1519
Thank you for your pull request. However, you have submitted your PR on a read-only
1620
split of `codeigniter4/CodeIgniter4`. This repository, unfortunately, does
1721
not accept PRs. Please submit your PR at https://github.com/codeigniter4/CodeIgniter4
1822
repository.<br/><br/>Thank you.
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
ISSUE: ${{ github.event.pull_request.html_url }}

0 commit comments

Comments
 (0)