@@ -16,51 +16,12 @@ jobs:
1616 runs-on : ubuntu-latest
1717
1818 steps :
19- - run : |
20- REPO_NAME="${{ github.event.pull_request.head.repo.full_name }}"
21- echo "REPO_NAME=${REPO_NAME}" >> "${GITHUB_ENV}"
22- - name : Close PullRequest
23- uses : actions/github-script@v6.1.0
24- env :
25- HEAD_REF : ${{github.event.pull_request.head.ref}}
26- if : env.REPO_NAME == github.repository
19+ - uses : actions/checkout@v3.0.2
20+ - uses : actions/setup-node@v3.3.0
21+ with :
22+ cache : npm
23+ - run : npm ci --prefer-offline
24+ - uses : dev-hato/actions-close-pr@v0.0.1
2725 with :
2826 github-token : ${{secrets.GITHUB_TOKEN}}
29- script : |
30- const HEAD_REF = process.env["HEAD_REF"]
31- const common_params = {
32- owner: context.repo.owner,
33- repo: context.repo.repo
34- }
35-
36- for (const head_name of ["increment-release-version" + HEAD_REF,
37- "fix-version-pre-commit-config" + HEAD_REF,
38- "fix-package" + HEAD_REF]) {
39- let head = "${{github.event.pull_request.head.repo.owner.login}}:"
40- head += head_name
41- const pulls_list_params = {
42- head,
43- base: HEAD_REF,
44- state: "open",
45- ...common_params
46- }
47- console.log("call pulls.list:", pulls_list_params)
48- const pulls = await github.paginate(github.rest.pulls.list,
49- pulls_list_params)
50-
51- for (const pull of pulls) {
52- const pulls_update_params = {
53- pull_number: pull.number,
54- state: "closed",
55- ...common_params
56- }
57- console.log("call pulls.update:", pulls_update_params)
58- await github.rest.pulls.update(pulls_update_params)
59- const git_deleteRef_params = {
60- ref: "heads/" + head_name,
61- ...common_params
62- }
63- console.log("call git.deleteRef:", git_deleteRef_params)
64- await github.rest.git.deleteRef(git_deleteRef_params)
65- }
66- }
27+ repo-name : ${{ github.event.pull_request.head.repo.full_name }}
0 commit comments