workflows/check: always run commits job
This is the very first step to extending the commits job to do more than just cherry-picks in the future: It could check reverts or merge commits, but also the commit message format and more. Of course, cherry-picks are still just checked on the stable branches as before. For now, this allows us to run the part that dismisses automated reviews automatically. This helps us when we do branch related checks in the prepare step, which would also create such a review. To avoid cluttering multiple reviews across a PR, we'll want all of these reviews to be handled by the same code, thus this change.
This commit is contained in:
@@ -7,7 +7,7 @@ import { program } from 'commander'
|
||||
import * as core from '@actions/core'
|
||||
import { getOctokit } from '@actions/github'
|
||||
|
||||
async function run(action, owner, repo, pull_number, dry = true) {
|
||||
async function run(action, owner, repo, pull_number, options = {}) {
|
||||
const token = execSync('gh auth token', { encoding: 'utf-8' }).trim()
|
||||
|
||||
const github = getOctokit(token)
|
||||
@@ -35,7 +35,8 @@ async function run(action, owner, repo, pull_number, dry = true) {
|
||||
},
|
||||
},
|
||||
core,
|
||||
dry,
|
||||
dry: true,
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -56,9 +57,10 @@ program
|
||||
.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) => {
|
||||
.option('--no-cherry-picks', 'Do not expect cherry-picks.')
|
||||
.action(async (owner, repo, pr, options) => {
|
||||
const commits = (await import('./commits.js')).default
|
||||
run(commits, owner, repo, pr)
|
||||
run(commits, owner, repo, pr, options)
|
||||
})
|
||||
|
||||
program
|
||||
@@ -74,7 +76,7 @@ program
|
||||
try {
|
||||
process.env.GITHUB_WORKSPACE = tmp
|
||||
process.chdir(tmp)
|
||||
run(labels, owner, repo, pr, options.dry)
|
||||
run(labels, owner, repo, pr, options)
|
||||
} finally {
|
||||
rmSync(tmp, { recursive: true })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user