1
0
mirror of synced 2025-12-19 18:10:59 -05:00
Files
docs/script/deleted-assets-pr-comment.js
2023-04-05 14:47:47 +00:00

32 lines
976 B
JavaScript
Executable File

#!/usr/bin/env node
// [start-readme]
//
// For testing the GitHub Action that executes
// .github/actions-scripts/deleted-assets-pr-comment.js but doing it
// locally.
// This is more convenient and faster than relying on seeing that the
// Action produces in a PR.
//
// To try it you need to generate a local `GITHUB_TOKEN` that has read-access
// "content" and "pull requests" on the repo.
// Example use:
//
// export GITHUB_TOKEN=github_pat_11AAAG.....
// ./script/deleted-assets-pr-comment.js github docs-internal main 4a0b0f2
//
// [end-readme]
import { program } from 'commander'
import main from '../.github/actions-scripts/deleted-assets-pr-comment.js'
program
.description('If applicable, print a snippet of Markdown about deleted assets')
.arguments('owner repo base_sha head_sha', 'Simulate what the Actions workflow does')
.parse(process.argv)
const opts = program.opts()
const args = program.args
console.log(await main(...args, { ...opts }))