Skip to content

Commit dcda279

Browse files
authored
move the error for github apps pipeline (github#38135)
1 parent ff6f13b commit dcda279

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

script/helpers/github.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff 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:

src/github-apps/scripts/sync.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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')

0 commit comments

Comments
 (0)