File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/env npx tsx
2+
3+ /** Update the required checks based on the current branch. */
4+
5+ import { parseArgs } from "node:util" ;
6+
7+ import { OLDEST_SUPPORTED_MAJOR_VERSION } from "./config" ;
8+
9+ async function main ( ) : Promise < void > {
10+ const { values : options } = parseArgs ( {
11+ options : {
12+ // The token to use to authenticate to the API.
13+ token : {
14+ type : "string" ,
15+ } ,
16+ // The git ref for which to retrieve the check runs.
17+ ref : {
18+ type : "string" ,
19+ } ,
20+ // By default, we perform a dry-run. Setting `apply` to `true` actually applies the changes.
21+ apply : {
22+ type : "boolean" ,
23+ default : false ,
24+ } ,
25+ } ,
26+ strict : true ,
27+ } ) ;
28+
29+ if ( options . token === undefined ) {
30+ throw new Error ( "Missing --token" ) ;
31+ }
32+ if ( options . ref === undefined ) {
33+ throw new Error ( "Missing --ref" ) ;
34+ }
35+
36+ console . info (
37+ `Oldest supported major version is: ${ OLDEST_SUPPORTED_MAJOR_VERSION } ` ,
38+ ) ;
39+
40+ process . exit ( 0 ) ;
41+ }
42+
43+ // Only call `main` if this script was run directly.
44+ if ( require . main === module ) {
45+ void main ( ) ;
46+ }
You can’t perform that action at this time.
0 commit comments