Skip to content

Commit 295d847

Browse files
authored
Make repo required & remove deprecated arg (#41)
1 parent 4117e39 commit 295d847

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

.changeset/afraid-ducks-know.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@changesets/ghcommit": major
3+
---
4+
5+
Make `repo` argument required,
6+
and remove the `repository` argument which was deprecated
7+
and previously could be used in its place.

src/core.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,16 @@ export const commitFilesFromBase64 = async ({
4949
octokit,
5050
owner,
5151
repo,
52-
repository,
5352
branch,
5453
base,
5554
force = false,
5655
message,
5756
fileChanges,
5857
log,
5958
}: CommitFilesFromBase64Args): Promise<CommitFilesResult> => {
60-
const repositoryNameWithOwner = `${owner}/${repository}`;
59+
const repositoryNameWithOwner = `${owner}/${repo}`;
6160
const baseRef = getBaseRef(base);
6261
const targetRef = `refs/heads/${branch}`;
63-
repo = repo ?? repository;
64-
65-
if (!repo) {
66-
throw new Error(`Argument 'repo' must be provided`);
67-
}
6862

6963
log?.debug(`Getting repo info ${repositoryNameWithOwner}`);
7064
const info = await getRepositoryMetadata(octokit, {

src/interface.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ export type GitBase =
2424
export interface CommitFilesBasedArgs {
2525
octokit: GitHubClient;
2626
owner: string;
27-
repo?: string;
28-
/** @deprecated use {@link repo} instead */
29-
repository?: string;
27+
repo: string;
3028
branch: string;
3129
/**
3230
* Push the commit even if the branch exists and does not match what was

0 commit comments

Comments
 (0)