Skip to content

Commit

Permalink
add script to initialize .dev.vars in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Aslemammad committed Mar 26, 2024
1 parent 58b6ddb commit 49bea05
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,12 @@ jobs:
node-version: 20
cache: "pnpm"
- run: pnpm install
- run: echo $NITRO_WEBHOOK_SECRET && pnpm build
- run: pnpm tsx script/ci.ts
working-directory: ./packages/backend
env:
NITRO_TEST: true
NITRO_WEBHOOK_SECRET: ${{ secrets.NITRO_WEBHOOK_SECRET }}
NITRO_APP_ID: ${{ secrets.NITRO_APP_ID }}
NITRO_PRIVATE_KEY: ${{ secrets.NITRO_PRIVATE_KEY }}
- run: pnpm build
- run: pnpm test
env:
NITRO_TEST: true
NITRO_WEBHOOK_SECRET: ${{ secrets.NITRO_WEBHOOK_SECRET }}
NITRO_APP_ID: ${{ secrets.NITRO_APP_ID }}
NITRO_PRIVATE_KEY: ${{ secrets.NITRO_PRIVATE_KEY }}
8 changes: 8 additions & 0 deletions packages/backend/script/ci.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import fs from "fs/promises";
if (process.env.CI) {
const content = Object.entries(process.env)
.filter(([k]) => k.startsWith("NITRO"))
.map(([k, v]) => `${k}=${v}`)
.join("\n");
await fs.writeFile(".dev.vars", content);
}

0 comments on commit 49bea05

Please sign in to comment.