forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeleted-assets-pr-comment.js
More file actions
executable file
·31 lines (26 loc) · 976 Bytes
/
deleted-assets-pr-comment.js
File metadata and controls
executable file
·31 lines (26 loc) · 976 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/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 }))