Skip to content

Commit

Permalink
chore: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Zaytsev committed Feb 11, 2024
1 parent 089367a commit 6f97ff6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ jobs:
test:
runs-on: ubuntu-latest
env:
GSAPI_TABLE_ID: ${{ secrets.GSAPI_TABLE_ID }}
GSAPI_CLIENT_EMAIL: ${{ secrets.GSAPI_CLIENT_EMAIL }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
ENV: ${{ secrets.ENV }} # .env file content
CI: true

steps:
Expand Down
12 changes: 7 additions & 5 deletions src/table.test.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import fs from 'node:fs';
import path from 'node:path';

import dotenv from 'dotenv';

import { Table } from './index';

dotenv.config();

// Github actions workflow
if (process.env.CI) {
process.env.GSAPI_CLIENT_PRIVATE_KEY = `-----BEGIN PRIVATE KEY-----
${process.env.PRIVATE_KEY}
-----END PRIVATE KEY-----`;
console.log('cwd', process.cwd());
fs.writeFileSync(path.join(process.cwd(), '.env'), process.env.ENV!);
}

dotenv.config();

console.log(
'process.env.GSAPI_CLIENT_PRIVATE_KEY',
process.env.GSAPI_CLIENT_PRIVATE_KEY,
Expand Down

0 comments on commit 6f97ff6

Please sign in to comment.