Skip to content

Make repo required & remove deprecated arg #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 10, 2025
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
7 changes: 7 additions & 0 deletions .changeset/afraid-ducks-know.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@changesets/ghcommit": major
---

Make `repo` argument required,
and remove the `repository` argument which was deprecated
and previously could be used in its place.
8 changes: 1 addition & 7 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,16 @@ export const commitFilesFromBase64 = async ({
octokit,
owner,
repo,
repository,
branch,
base,
force = false,
message,
fileChanges,
log,
}: CommitFilesFromBase64Args): Promise<CommitFilesResult> => {
const repositoryNameWithOwner = `${owner}/${repository}`;
const repositoryNameWithOwner = `${owner}/${repo}`;
const baseRef = getBaseRef(base);
const targetRef = `refs/heads/${branch}`;
repo = repo ?? repository;

if (!repo) {
throw new Error(`Argument 'repo' must be provided`);
}

log?.debug(`Getting repo info ${repositoryNameWithOwner}`);
const info = await getRepositoryMetadata(octokit, {
Expand Down
4 changes: 1 addition & 3 deletions src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ export type GitBase =
export interface CommitFilesBasedArgs {
octokit: GitHubClient;
owner: string;
repo?: string;
/** @deprecated use {@link repo} instead */
repository?: string;
repo: string;
branch: string;
/**
* Push the commit even if the branch exists and does not match what was
Expand Down