diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 74487e11..94e8ac0a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,6 @@ jobs: - name: Create .env file run: | echo "RUDDER_STACK_KEY=1" > .env - echo "RUDDER_STACK_KEY=2" > ./bin/.env - name: Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/src/utils/analytics.ts b/src/utils/analytics.ts index 8db2a031..492c7379 100644 --- a/src/utils/analytics.ts +++ b/src/utils/analytics.ts @@ -1,10 +1,12 @@ import RudderAnalytics from "@rudderstack/rudder-sdk-node"; -import * as dotenv from "dotenv"; +import dotenv from "dotenv"; import { machineId } from "node-machine-id"; import type { apiObject } from "@rudderstack/rudder-sdk-node"; +import path from "path"; -dotenv.config(); +const envPath = path.join(__dirname, '../../', '.env'); +dotenv.config({ path: envPath }); console.log("test", process.env.RUDDER_STACK_KEY!);