Skip to content

Commit

Permalink
use dotenv to load lambda secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
lokesh-couchbase committed Jan 31, 2024
1 parent 1417960 commit 161e999
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- shell: pwsh
env:
FEEDBACK_LAMBDA_SECRET: ${{ secrets.FEEDBACK_LAMBDA_SECRET }}
FEEDBACK_LAMBDA_URL: ${{ secrets.FEEDBACK_LAMBDA_URL }}
run: echo "target=${{ matrix.platform }}-${{ matrix.arch }}" >> $env:GITHUB_ENV
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down
12 changes: 12 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
"d3-zoom": "^1.8.3",
"dayjs": "^1.11.9",
"decompress": "^4.2.1",
"dotenv": "^16.4.1",
"gitly": "^2.4.2",
"keytar": "^7.7.0",
"monaco-editor": "^0.43.0",
Expand Down
10 changes: 8 additions & 2 deletions src/util/secretUpdater.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { ExtensionContext } from "vscode";
import * as dotenv from 'dotenv';

// Before Building, Please update secrets else IQ Feedback service will not work
export const secretUpdater = (context: ExtensionContext) => {
context.globalState.update("feedbackLambdaSecret", "c0uchbase_is_aw3some");
context.globalState.update("feedbackLambdaUrl", "https://nms548yy5b.execute-api.us-west-1.amazonaws.com/Prod/");
dotenv.config();
console.log(process.env);
console.log("secret: ", process.env.FEEDBACK_LAMBDA_SECRET);
console.log("url: ", process.env.FEEDBACK_LAMBDA_URL);

context.globalState.update("feedbackLambdaSecret", process.env.FEEDBACK_LAMBDA_SECRET);
context.globalState.update("feedbackLambdaUrl", process.env.FEEDBACK_LAMBDA_URL);
};

0 comments on commit 161e999

Please sign in to comment.