Skip to content

Commit

Permalink
fix usage of files to load secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiago Posse committed Sep 28, 2023
1 parent 90a8506 commit 91f4646
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/gitlab/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async function resolveGitlabApiToken(): Promise<string> {
}

if (process.env.GITLAB_API_TOKEN_FILE !== undefined) {
if (fs.existsSync(process.env.GITLAB_API_TOKEN_FILE)) {
if (!fs.existsSync(process.env.GITLAB_API_TOKEN_FILE)) {
throw Error(`Gitlab API token file does not exist: ${process.env.GITLAB_API_TOKEN_FILE}`)
}
return (fs.readFileSync(process.env.GITLAB_API_TOKEN_FILE)).toString()
Expand Down
2 changes: 1 addition & 1 deletion src/gitlab/scim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async function resolveGitlabScimToken(): Promise<string> {
}

if (process.env.GITLAB_SCIM_TOKEN_FILE !== undefined) {
if (fs.existsSync(process.env.GITLAB_SCIM_TOKEN_FILE)) {
if (!fs.existsSync(process.env.GITLAB_SCIM_TOKEN_FILE)) {
throw Error(`Gitlab SCIM token file does not exist: ${process.env.GITLAB_SCIM_TOKEN_FILE}`)
}
return (fs.readFileSync(process.env.GITLAB_SCIM_TOKEN_FILE)).toString()
Expand Down
2 changes: 1 addition & 1 deletion src/google/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async function resolveGoogleServiceAcccount() {
}

if (process.env.GOOGLE_SA_KEY_FILE !== undefined) {
if (fs.existsSync(process.env.GOOGLE_SA_KEY_FILE)) {
if (!fs.existsSync(process.env.GOOGLE_SA_KEY_FILE)) {
throw Error(`Google service account file does not exist: ${process.env.GOOGLE_SA_KEY_FILE}`)
}
return
Expand Down
2 changes: 1 addition & 1 deletion src/utils/mappings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ async function resolveMappings(): Promise<string> {
}

if (process.env.ROLE_MAPPINGS_FILE !== undefined) {
if (fs.existsSync(process.env.ROLE_MAPPINGS_FILE)) {
if (!fs.existsSync(process.env.ROLE_MAPPINGS_FILE)) {
throw Error(`Role mappings file does not exist: ${process.env.ROLE_MAPPINGS_FILE}`)
}
return (fs.readFileSync(process.env.ROLE_MAPPINGS_FILE)).toString()
Expand Down

0 comments on commit 91f4646

Please sign in to comment.