3

Adobe provides scripts for their I/O API that need a few parameters. They should be kept secret, but I still want to push my package.json to a git repo. One of my scripts should look like this:
npx @adobe/reactor-uploader my-package-1.0.0.zip --private-key=private.key --org-id=%ORG_ID% --tech-account-id=%TECH_ACC_ID% --api-key=%API_KEY% --client-secret=%CLIENT_SECRET%

The private.key luckily already is loaded from a file, but the other 4 arguments should also be loaded from a "config" file that is not checked in. I looked at dotenv, but I can't figure out how to apply these to an npx script. Here an example of my .env file:

ORG_ID=A
TECH_ACC_ID=B
API_KEY=C
CLIENT_SECRET=D

Is this even possible or are there other ways to achieve this.

EDIT: I found a way with a script, but still wondering if there is a direct way in package.json

require('dotenv').config();
const { execSync } = require('child_process');
execSync(`npx @adobe/reactor-uploader my-package-1.0.0.zip --private-key=secret/private.key --org-id=${process.env.ORG_ID} --tech-account-id=${process.env.TECH_ACC_ID} --api-key=${process.env.API_KEY} --client-secret=${process.env.CLIENT_SECRET}`, { stdio: 'inherit' });
Thomas
  • 6,325
  • 4
  • 30
  • 65

0 Answers0