| name: Re-run CI tests on open PRs |
| - name: (GET-&-PUT Github API) Push empty commit to PR branch |
| uses: actions/github-script@0.2.0 |
| github-token: ${{secrets.PAT}} |
| const owner = context.repo.owner; |
| const repo = context.repo.repo; |
| const {data: pullRequests} = await github.pulls.list({ |
| for (pr of pullRequests) { |
| while (pullReq.mergeable === undefined || pullReq.mergeable === null) { |
| if(pullReq.mergeable === false) continue; |
| const {data: commitData} = await github.repos.getCommit({ |
| const {data: createdCommit} = await github.git.createCommit({ |
| message: "trigger github actions", |
| tree: commitData.commit.tree.sha, |
| parents: [commitData.sha], |
| commiter: context.payload.pusher, |
| author: context.payload.pusher, |
| await github.git.updateRef({ |
| ref: `heads/${pr.head.ref}`, |