@@ -9,6 +9,7 @@ import * as yaml from "yaml";
99
1010import {
1111 type ApiClient ,
12+ CODEQL_ACTION_REPO ,
1213 getApiClient ,
1314 TOKEN_OPTION_CONFIG ,
1415 TokenOption ,
@@ -28,12 +29,6 @@ export interface Options extends TokenOption {
2829 verbose : boolean ;
2930}
3031
31- /** Identifies the CodeQL Action repository. */
32- const codeqlActionRepo = {
33- owner : "github" ,
34- repo : "codeql-action" ,
35- } ;
36-
3732/** Represents a configuration of which checks should not be set up as required checks. */
3833export interface Exclusions {
3934 /** A list of strings that, if contained in a check name, are excluded. */
@@ -103,7 +98,7 @@ async function getChecksFor(
10398 const response = await client . paginate (
10499 "GET /repos/{owner}/{repo}/commits/{ref}/check-runs" ,
105100 {
106- ...codeqlActionRepo ,
101+ ...CODEQL_ACTION_REPO ,
107102 ref,
108103 } ,
109104 ) ;
@@ -136,7 +131,7 @@ async function getChecksFor(
136131/** Gets the current list of release branches. */
137132async function getReleaseBranches ( client : ApiClient ) : Promise < string [ ] > {
138133 const refs = await client . rest . git . listMatchingRefs ( {
139- ...codeqlActionRepo ,
134+ ...CODEQL_ACTION_REPO ,
140135 ref : "heads/releases/v" ,
141136 } ) ;
142137 return refs . data . map ( ( ref ) => ref . ref ) . sort ( ) ;
@@ -149,7 +144,7 @@ async function patchBranchProtectionRule(
149144 checks : Set < string > ,
150145) {
151146 await client . rest . repos . setStatusCheckContexts ( {
152- ...codeqlActionRepo ,
147+ ...CODEQL_ACTION_REPO ,
153148 branch,
154149 contexts : Array . from ( checks ) ,
155150 } ) ;
@@ -166,7 +161,7 @@ async function updateBranch(
166161
167162 // Query the current set of required checks for this branch.
168163 const currentContexts = await client . rest . repos . getAllStatusCheckContexts ( {
169- ...codeqlActionRepo ,
164+ ...CODEQL_ACTION_REPO ,
170165 branch,
171166 } ) ;
172167
0 commit comments