Skip to content

Commit

Permalink
Merge pull request #139 from gentlementlegen/fix/env
Browse files Browse the repository at this point in the history
feat: add environment variable to configuration
  • Loading branch information
gentlementlegen authored Oct 11, 2024
2 parents 88798bd + c3dc29d commit 6d443e7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .dev.vars.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
WEBHOOK_PROXY_URL=https://smee.io/new
APP_WEBHOOK_SECRET=xxxxxx
APP_ID=123456
ENVIRONMENT=development | production
2 changes: 2 additions & 0 deletions .github/workflows/worker-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ jobs:
APP_ID
APP_PRIVATE_KEY
APP_WEBHOOK_SECRET
ENVIRONMENT
env:
APP_WEBHOOK_SECRET: ${{ secrets.APP_WEBHOOK_SECRET }}
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
ENVIRONMENT: ${{ secrets.ENVIRONMENT }}

- name: Write Deployment URL to Summary
run: |
Expand Down
2 changes: 1 addition & 1 deletion src/github/types/env.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Type as T, type Static } from "@sinclair/typebox";

export const envSchema = T.Object({
ENVIRONMENT: T.Union([T.Literal("production"), T.Literal("development")]),
ENVIRONMENT: T.Union([T.Literal("production"), T.Literal("development")], { default: "development" }),
APP_WEBHOOK_SECRET: T.String({ minLength: 1 }),
APP_ID: T.String({ minLength: 1 }),
APP_PRIVATE_KEY: T.String({ minLength: 1 }),
Expand Down

0 comments on commit 6d443e7

Please sign in to comment.