File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -6,13 +6,6 @@ if (!process.env.GITHUB_TOKEN) {
66 dotenv . config ( )
77}
88
9- // check for required PAT
10- if ( ! process . env . GITHUB_TOKEN ) {
11- throw new Error (
12- 'Error! You must have a GITHUB_TOKEN set in an .env file to use the GitHub REST API.'
13- )
14- }
15-
169// this module needs to work in development, production, and GitHub Actions
1710//
1811// GITHUB_TOKEN comes from one of the following sources:
Original file line number Diff line number Diff line change @@ -157,6 +157,14 @@ async function getProgAccessData(progAccessSource) {
157157 let progActorResources
158158 const progAccessFilepath = 'config/access_control/programmatic_access.yaml'
159159 const progActorFilepath = 'config/locales/programmatic_actor_fine_grained_resources.en.yml'
160+
161+ // check for required PAT
162+ if ( ! process . env . GITHUB_TOKEN ) {
163+ throw new Error (
164+ 'Error! You must have the GITHUB_TOKEN environment variable set to access the programmatic access and resource files via the GitHub REST API.'
165+ )
166+ }
167+
160168 if ( progAccessSource ) {
161169 progAccessDataRaw = yaml . load (
162170 await readFile ( path . join ( progAccessSource , progAccessFilepath ) , 'utf8' )
You can’t perform that action at this time.
0 commit comments