Skip to content

Commit

Permalink
using existing env
Browse files Browse the repository at this point in the history
  • Loading branch information
robmoffat committed Jan 21, 2025
1 parent 28b901a commit 62edb9d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"npm": "^10.3.0"
},
"scripts": {
"build": "npm run decrypt-service-account && npm run setup-env && npm run download-ics && npm run get-events && gatsby build",
"build": "npm run decrypt-service-account && npm run download-ics && npm run get-events && gatsby build",
"develop": "npm run get-mock-events && gatsby develop",
"start": "gatsby develop",
"serve": "gatsby serve",
Expand All @@ -18,7 +18,6 @@
"get-mock-events": "node ./scripts/setMock.js",
"decrypt-service-account": "gpg --quiet --batch --yes --decrypt --passphrase=${GOOGLE_SERVICE_ACCOUNT_PASSPHRASE} --output calendar-service-account.json calendar-service-account.json.gpg",
"download-ics": "npx mkdirp dist && curl -o dist/basic.ics https://calendar.google.com/calendar/ical/finos.org_fac8mo1rfc6ehscg0d80fi8jig%40group.calendar.google.com/public/basic.ics",
"setup-env": "export SERVICE_ACCOUNT=`cat calendar-service-account.json`",
"get-events": "npx mkdirp dist && node ./scripts/googleapi2events.mjs",
"getEvents": "npm run get-events",
"test": "vitest"
Expand Down
2 changes: 1 addition & 1 deletion src/api/signup-submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default async function handler(req, res) {

const eventId = req.body.eventId;

const CREDENTIALS = JSON.parse(process.env.SERVICE_ACCOUNT) ? process.env.SERVICE_ACCOUNT : require('./calendar-service-account.json')
const CREDENTIALS = JSON.parse(process.env.GOOGLE_SERVICE_ACCOUNT) ? process.env.GOOGLE_SERVICE_ACCOUNT : require('./calendar-service-account.json')

console.log(`CREDENTIALS`, CREDENTIALS)

Expand Down

0 comments on commit 62edb9d

Please sign in to comment.