Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
mchambaud authored Jul 29, 2024
2 parents fa0edc4 + 6377e1b commit 6d1069e
Show file tree
Hide file tree
Showing 6 changed files with 176 additions and 522 deletions.
11 changes: 0 additions & 11 deletions lib/definitions/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,6 @@ By default the \`repositoryUrl\` option is retrieved from the \`repository\` pro
};
}

export function EMISMATCHGITHUBURL() {
return {
message: "The git repository URL mismatches the GitHub URL.",
details: `The **semantic-release** \`repositoryUrl\` option must match your GitHub URL with the format \`<GitHub_or_GHE_URL>/<owner>/<repo>.git\`.
By default the \`repositoryUrl\` option is retrieved from the \`repository\` property of your \`package.json\` or the [git origin url](https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes) of the repository cloned by your CI environment.
Note: If you have recently changed your GitHub repository name or owner, update the value in **semantic-release** \`repositoryUrl\` option and the \`repository\` property of your \`package.json\` respectively to match the new GitHub URL.`,
};
}

export function EINVALIDPROXY({ proxy }) {
return {
message: "Invalid `proxy` option.",
Expand Down
27 changes: 0 additions & 27 deletions lib/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,33 +144,6 @@ export default async function verify(pluginConfig, context, { Octokit }) {
}
}

// Verify if Repository Name wasn't changed
if (
owner &&
repo &&
githubToken &&
!errors.find(({ code }) => code === "EINVALIDPROXY") &&
!errors.find(({ code }) => code === "EMISSINGREPO")
) {
const octokit = new Octokit(
toOctokitOptions({
githubToken,
githubUrl,
githubApiPathPrefix,
githubApiUrl,
proxy,
}),
);

const {
status,
data: { clone_url },
} = await octokit.request("GET /repos/{owner}/{repo}", { owner, repo });
if (status !== 200 || repositoryUrl !== clone_url) {
errors.push(getError("EMISMATCHGITHUBURL"));
}
}

if (!githubToken) {
errors.push(getError("ENOGHTOKEN", { owner, repo }));
}
Expand Down
Loading

0 comments on commit 6d1069e

Please sign in to comment.