Skip to content

Commit 90c8334

Browse files
committed
chore: add missing --api-key option to ci
1 parent 8b42f7c commit 90c8334

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

.changeset/wise-camels-hammer.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"lingo.dev": patch
3+
---
4+
5+
add missing --api-key option to ci

packages/cli/src/cli/cmd/ci/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { InBranchFlow } from "./flows/in-branch";
88
import { getPlatformKit } from "./platforms";
99

1010
interface CIOptions {
11+
apiKey?: string;
1112
pullRequest?: boolean;
1213
commitMessage?: string;
1314
pullRequestTitle?: string;
@@ -19,14 +20,14 @@ export default new Command()
1920
.command("ci")
2021
.description("Run Lingo.dev CI/CD action")
2122
.helpOption("-h, --help", "Show help")
23+
.option("--api-key <key>", "API key")
2224
.option("--pull-request", "Create a pull request with the changes", false)
2325
.option("--commit-message <message>", "Commit message")
2426
.option("--pull-request-title <title>", "Pull request title")
2527
.option("--working-directory <dir>", "Working directory")
2628
.option("--process-own-commits", "Process commits made by this action", false)
27-
.action(async (options: CIOptions, program) => {
28-
const apiKey = program.args[0];
29-
const settings = getSettings(apiKey);
29+
.action(async (options: CIOptions) => {
30+
const settings = getSettings(options.apiKey);
3031

3132
if (!settings.auth.apiKey) {
3233
console.error("No API key provided");

packages/cli/src/cli/utils/observability.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export default async function trackEvent(
99

1010
try {
1111
const { PostHog } = await import("posthog-node");
12+
console.log("--- ---");
1213
const safeProperties = properties
1314
? JSON.parse(
1415
JSON.stringify(properties, (key, value) => {
@@ -33,6 +34,7 @@ export default async function trackEvent(
3334
},
3435
);
3536

37+
console.log("--- ---");
3638
await posthog.capture({
3739
distinctId,
3840
event,
@@ -45,7 +47,10 @@ export default async function trackEvent(
4547
},
4648
});
4749

50+
console.log("--- ---");
4851
await posthog.shutdown();
52+
53+
console.log("--- ---");
4954
} catch (error) {
5055
if (process.env.DEBUG) {
5156
console.error(error);

0 commit comments

Comments
 (0)