Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tidy-chefs-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@changesets/ghcommit": major
---

Remove `log` argument from APIs. If you need to debug the package, use breakpoints or manually add logs in the package code.
5 changes: 1 addition & 4 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# needed got pnpm test:ci
# needed for pnpm test:integration
GITHUB_TOKEN='<...some token>'
GITHUB_REPOSITORY=changesets/ghcommit

# Debug Logging
# RUNNER_DEBUG=1
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ All the functions below accept a single object as its argument, and share the fo
* The commit message
*/
message: string | CommitMessage;
log?: Logger;
}
```

Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@
"oxfmt": "^0.53.0",
"oxlint": "^1.68.0",
"oxlint-tsgolint": "^0.23.0",
"pino": "^9.3.2",
"pino-pretty": "^11.2.2",
"publint": "^0.3.21",
"tsdown": "^0.22.1",
"typescript": "^6.0.3",
Expand Down
260 changes: 0 additions & 260 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,17 @@ export const commitFilesFromBase64 = async ({
force = false,
message,
fileChanges,
log,
}: CommitFilesFromBase64Args): Promise<CommitFilesResult> => {
const repositoryNameWithOwner = `${owner}/${repo}`;
const baseRef = getBaseRef(base);
const targetRef = `refs/heads/${branch}`;

log?.debug(`Getting repo info ${repositoryNameWithOwner}`);
const info = await getRepositoryMetadata(octokit, {
owner,
repo,
baseRef,
targetRef,
});
log?.debug(`Repo info: ${JSON.stringify(info, null, 2)}`);

if (!info) {
throw new Error(
Expand Down Expand Up @@ -181,7 +178,6 @@ export const commitFilesFromBase64 = async ({
tempRefId = refIdStr;
}

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

log?.debug(`Creating commit on branch ${branch}`);
const newCommit = await createCommit({
octokit,
refId,
Expand Down
2 changes: 0 additions & 2 deletions src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type {
FileChanges,
} from "./github/graphql/generated/types.ts";
import type { GitHubClient } from "./github/graphql/queries.ts";
import type { Logger } from "./logging.ts";

export type CommitFilesResult = {
refId: string | null;
Expand Down Expand Up @@ -34,7 +33,6 @@ export interface CommitFilesBasedArgs {
* The commit message
*/
message: string | CommitMessage;
log?: Logger;
}

export interface CommitFilesSharedArgsWithBase extends CommitFilesBasedArgs {
Expand Down
6 changes: 0 additions & 6 deletions src/logging.ts

This file was deleted.

8 changes: 0 additions & 8 deletions tests/integration/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import crypto from "node:crypto";
import { getOctokit } from "@actions/github";
import { pino } from "pino";
import { expect } from "vitest";
import {
deleteRefMutation,
Expand All @@ -13,13 +12,6 @@ export const [owner, repo] = process.env.GITHUB_REPOSITORY!.split("/")!;

export const octokit = getOctokit(githubToken);

export const log = pino({
level: process.env.RUNNER_DEBUG === "1" ? "debug" : "info",
transport: {
target: "pino-pretty",
},
});

/**
* GitHub sometimes has a delay between making changes to a git repo,
* and those changes being reflected in the API.
Expand Down