ci/github-script/prepare: init from actions/get-merge-commit

This just moves the code over to ci/github-script to make it easy to
test and iterate on locally.

The name `prepare` is chosen, because the script will be extended with
the other steps from "PR / prepare" next.
This commit is contained in:
Wolfgang Walther
2025-08-16 14:25:39 +02:00
parent 2087f1be30
commit c787c66de6
5 changed files with 66 additions and 45 deletions

View File

@@ -39,6 +39,17 @@ async function run(action, owner, repo, pull_number, dry = true) {
})
}
program
.command('prepare')
.description('Prepare relevant information of a pull request.')
.argument('<owner>', 'Owner of the GitHub repository to check (Example: NixOS)')
.argument('<repo>', 'Name of the GitHub repository to check (Example: nixpkgs)')
.argument('<pr>', 'Number of the Pull Request to check')
.action(async (owner, repo, pr) => {
const prepare = (await import('./prepare.js')).default
run(prepare, owner, repo, pr)
})
program
.command('commits')
.description('Check commit structure of a pull request.')