Skip to content

Commit

Permalink
Use Bearer token in ci workflow
Browse files Browse the repository at this point in the history
When authenticating against a live dpl-cms site, we need to authenticate the request with a Bearer token
  • Loading branch information
JacobArrow committed Jan 22, 2025
1 parent 98c3a39 commit 021024e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { CodegenConfig } from "@graphql-codegen/cli"
import goConfig from "./lib/config/goConfig"

const { loadEnvConfig } = require("@next/env")
const isCI = process.env.CI === "true"

loadEnvConfig(process.cwd())

Expand All @@ -15,7 +16,7 @@ const config: CodegenConfig = {
schema: {
[`${process.env.NEXT_PUBLIC_GRAPHQL_SCHEMA_ENDPOINT_DPL_CMS}`]: {
headers: {
Authorization: `Basic ${process.env.GRAPHQL_SCHEMA_ENDPOINT_BASIC_TOKEN_DPL_CMS}`,
Authorization: `${isCI ? "Bearer" : "Basic"} ${process.env.NEXT_PUBLIC_GRAPHQL_BASIC_TOKEN_DPL_CMS}`,
},
},
},
Expand Down

0 comments on commit 021024e

Please sign in to comment.