Skip to content

Commit ead1e55

Browse files
authored
Remove log argument (#110)
1 parent 8b5585d commit ead1e55

9 files changed

Lines changed: 6 additions & 288 deletions

File tree

.changeset/tidy-chefs-bake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@changesets/ghcommit": major
3+
---
4+
5+
Remove `log` argument from APIs. If you need to debug the package, use breakpoints or manually add logs in the package code.

.env.example

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# needed got pnpm test:ci
1+
# needed for pnpm test:integration
22
GITHUB_TOKEN='<...some token>'
33
GITHUB_REPOSITORY=changesets/ghcommit
4-
5-
# Debug Logging
6-
# RUNNER_DEBUG=1

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ All the functions below accept a single object as its argument, and share the fo
7373
* The commit message
7474
*/
7575
message: string | CommitMessage;
76-
log?: Logger;
7776
}
7877
```
7978

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@
5959
"oxfmt": "^0.53.0",
6060
"oxlint": "^1.68.0",
6161
"oxlint-tsgolint": "^0.23.0",
62-
"pino": "^9.3.2",
63-
"pino-pretty": "^11.2.2",
6462
"publint": "^0.3.21",
6563
"tsdown": "^0.22.1",
6664
"typescript": "^6.0.3",

pnpm-lock.yaml

Lines changed: 0 additions & 260 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,20 +84,17 @@ export const commitFilesFromBase64 = async ({
8484
force = false,
8585
message,
8686
fileChanges,
87-
log,
8887
}: CommitFilesFromBase64Args): Promise<CommitFilesResult> => {
8988
const repositoryNameWithOwner = `${owner}/${repo}`;
9089
const baseRef = getBaseRef(base);
9190
const targetRef = `refs/heads/${branch}`;
9291

93-
log?.debug(`Getting repo info ${repositoryNameWithOwner}`);
9492
const info = await getRepositoryMetadata(octokit, {
9593
owner,
9694
repo,
9795
baseRef,
9896
targetRef,
9997
});
100-
log?.debug(`Repo info: ${JSON.stringify(info, null, 2)}`);
10198

10299
if (!info) {
103100
throw new Error(
@@ -181,7 +178,6 @@ export const commitFilesFromBase64 = async ({
181178
tempRefId = refIdStr;
182179
}
183180

184-
log?.debug(`Creating commit on branch ${tempBranch}`);
185181
const tempCommit = await createCommit({
186182
octokit,
187183
refId: tempRefId,
@@ -244,7 +240,6 @@ export const commitFilesFromBase64 = async ({
244240
refId = sameBranchBase ? resolvedBaseRef!.id : info.targetBranch!.id;
245241
}
246242

247-
log?.debug(`Creating commit on branch ${branch}`);
248243
const newCommit = await createCommit({
249244
octokit,
250245
refId,

src/interface.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type {
33
FileChanges,
44
} from "./github/graphql/generated/types.ts";
55
import type { GitHubClient } from "./github/graphql/queries.ts";
6-
import type { Logger } from "./logging.ts";
76

87
export type CommitFilesResult = {
98
refId: string | null;
@@ -34,7 +33,6 @@ export interface CommitFilesBasedArgs {
3433
* The commit message
3534
*/
3635
message: string | CommitMessage;
37-
log?: Logger;
3836
}
3937

4038
export interface CommitFilesSharedArgsWithBase extends CommitFilesBasedArgs {

src/logging.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

tests/integration/utils.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import crypto from "node:crypto";
22
import { getOctokit } from "@actions/github";
3-
import { pino } from "pino";
43
import { expect } from "vitest";
54
import {
65
deleteRefMutation,
@@ -13,13 +12,6 @@ export const [owner, repo] = process.env.GITHUB_REPOSITORY!.split("/")!;
1312

1413
export const octokit = getOctokit(githubToken);
1514

16-
export const log = pino({
17-
level: process.env.RUNNER_DEBUG === "1" ? "debug" : "info",
18-
transport: {
19-
target: "pino-pretty",
20-
},
21-
});
22-
2315
/**
2416
* GitHub sometimes has a delay between making changes to a git repo,
2517
* and those changes being reflected in the API.

0 commit comments

Comments
 (0)