Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: load environment variables from 1Password #28

Merged
merged 5 commits into from
Apr 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 11 additions & 21 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,12 @@ on:
type: boolean

secrets:
READONLY_NPM_TOKEN:
description: Needed to install private @hedia npm packages
OP_SERVICE_ACCOUNT_TOKEN:
description: Required to load environment variables stored in 1Password
required: true
SONAR_TOKEN:
description: Needed to run SonarCloud Scan
READONLY_NPM_TOKEN:
description: Required to install private @hedia npm packages
required: true
BREVO_API_KEY:
description: Token needed to authenticate requests to Brevo API if any
required: false
PRIVATE_KEY:
description: Private JSON Web Key that might be needed to run test script
required: false
PUBLIC_KEY:
description: Public JSON Web Key that might be needed to run test script
required: false
SLACK_APP_TOKEN:
description: Token to authenticate requests to Slack API if necessary
required: false

jobs:
test:
Expand Down Expand Up @@ -67,6 +55,9 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install 1Password CLI
uses: 1password/install-cli-action@v1

- name: Setup Node.js Environment
uses: actions/setup-node@v4
with:
Expand All @@ -87,14 +78,13 @@ jobs:
path: .
pattern: dist

- name: Create .env
- name: Load Environment Variables
run: npm run env:github --if-present
env:
ENV_FILE: ${{secrets.ENV_FILE}}
if: env.ENV_FILE != null
run: echo "$ENV_FILE" > .env
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}

- name: Setup Service
run: NODE_ENV=test npm run setup --if-present
run: npm run setup --if-present

- name: Run Tests
run: npm run test
Expand Down
Loading