diff --git a/.dev.vars.example b/.dev.vars.example index aae3fc5..4278157 100644 --- a/.dev.vars.example +++ b/.dev.vars.example @@ -1,3 +1,4 @@ WEBHOOK_PROXY_URL=https://smee.io/new APP_WEBHOOK_SECRET=xxxxxx APP_ID=123456 +ENVIRONMENT=development | production diff --git a/.github/workflows/worker-deploy.yml b/.github/workflows/worker-deploy.yml index 41f3703..a5631a1 100644 --- a/.github/workflows/worker-deploy.yml +++ b/.github/workflows/worker-deploy.yml @@ -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: | diff --git a/src/github/types/env.ts b/src/github/types/env.ts index 4eca283..3f73306 100644 --- a/src/github/types/env.ts +++ b/src/github/types/env.ts @@ -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 }),