···
import { program } from 'commander'
import { getOctokit } from '@actions/github'
9
-
async function run(action, owner, repo, pull_number) {
9
+
async function run(action, owner, repo, pull_number, dry) {
const token = execSync('gh auth token', { encoding: 'utf-8' }).trim()
const github = getOctokit(token)
···
rmSync(tmp, { recursive: true })
···
.argument('<owner>', 'Owner of the GitHub repository to label (Example: NixOS)')
.argument('<repo>', 'Name of the GitHub repository to label (Example: nixpkgs)')
.argument('[pr]', 'Number of the Pull Request to label')
61
-
.action(async (owner, repo, pr) => {
61
+
.option('--no-dry', 'Make actual modifications')
62
+
.action(async (owner, repo, pr, options) => {
const labels = (await import('./labels.js')).default
63
-
run(labels, owner, repo, pr)
64
+
run(labels, owner, repo, pr, options.dry)