Skip to content

add github-script

add github-script #7

Workflow file for this run

on:
push:
jobs:
trigger-pr-update:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
with:
script: |
// Get a list of all issues created by the PR opener
// See: https://octokit.github.io/rest.js/#pagination
const creator = context.payload.sender.login
const prs = await github.request('GET /repos/{owner}/{repo}/pulls', {
owner: context.repo.owner,
repo: context.repo.repo,
headers: {
'X-GitHub-Api-Version': '2022-11-28'
}
})
console.log(prs);
for (const pr of prs.data) {
await github.request('PATCH /repos/{owner}/{repo}/pulls/{pull_number}', {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pr.number,
base: 'develop',
headers: {
'X-GitHub-Api-Version': '2022-11-28'
}
})
break;
}