Skip to content
Merged
Changes from 1 commit
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
Next Next commit
Inject secrets to the key.json file
  • Loading branch information
fabidick22 committed Mar 25, 2020
commit e0363cd24091aba993b5b9d50b393ab385d05636
23 changes: 23 additions & 0 deletions .github/workflows/CI-time-tracker-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
types: [opened, edited, reopened, synchronize]
branches:
- master
push:
branches:
- '*'

jobs:
security-audit:
Expand Down Expand Up @@ -39,5 +42,25 @@ jobs:
- name: Install dependencies
run: npm install

- name: Inject Secrets
shell: python
env:
SCOPES: {{ $secrets.scopes }}
CLIENT_ID: {{ $secrets.client_id }}
AUTHORITY: {{ $secrets.authority }}
BASE_PATH: "src/environments/"
run: |
import os
import json
data = {}
base_path = os.environ.get('BASE_PATH', 'src/environments/')
with open(base_path + "keys.example.json", "r+") as jsonFileRead:
data = json.load(jsonFileRead)
data["scopes"] = str(os.environ['SCOPES']).split(",")
data["client_id"] = os.environ['CLIENT_ID']
data["authority"] = os.environ['AUTHORITY']
with open(base_path + "keys.json", "w+") as jsonFileWrite:
json.dump(data, jsonFileWrite)

- name: Run the test
run: npm run ci-test --if-present