@semantic-release/github 10.1.0 → 10.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -139,6 +139,17 @@ By default the \`repositoryUrl\` option is retrieved from the \`repository\` pro
139
139
  };
140
140
  }
141
141
 
142
+ export function EMISMATCHGITHUBURL() {
143
+ return {
144
+ message: "The git repository URL mismatches the GitHub URL.",
145
+ details: `The **semantic-release** \`repositoryUrl\` option must match your GitHub URL with the format \`<GitHub_or_GHE_URL>/<owner>/<repo>.git\`.
146
+
147
+ 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.
148
+
149
+ 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.`,
150
+ };
151
+ }
152
+
142
153
  export function EINVALIDPROXY({ proxy }) {
143
154
  return {
144
155
  message: "Invalid `proxy` option.",
package/lib/success.js CHANGED
@@ -54,7 +54,10 @@ export default async function success(pluginConfig, context, { Octokit }) {
54
54
 
55
55
  const errors = [];
56
56
 
57
- if (successComment === false) {
57
+ if (successComment === false || isEmpty(commits)) {
58
+ if (isEmpty(commits)) {
59
+ logger.log("No commits found in release");
60
+ }
58
61
  logger.log("Skip commenting on issues and pull requests.");
59
62
  } else {
60
63
  const parser = issueParser(
package/lib/verify.js CHANGED
@@ -144,6 +144,33 @@ export default async function verify(pluginConfig, context, { Octokit }) {
144
144
  }
145
145
  }
146
146
 
147
+ // Verify if Repository Name wasn't changed
148
+ if (
149
+ owner &&
150
+ repo &&
151
+ githubToken &&
152
+ !errors.find(({ code }) => code === "EINVALIDPROXY") &&
153
+ !errors.find(({ code }) => code === "EMISSINGREPO")
154
+ ) {
155
+ const octokit = new Octokit(
156
+ toOctokitOptions({
157
+ githubToken,
158
+ githubUrl,
159
+ githubApiPathPrefix,
160
+ githubApiUrl,
161
+ proxy,
162
+ }),
163
+ );
164
+
165
+ const {
166
+ status,
167
+ data: { clone_url },
168
+ } = await octokit.request("GET /repos/{owner}/{repo}", { owner, repo });
169
+ if (status !== 200 || repositoryUrl !== clone_url) {
170
+ errors.push(getError("EMISMATCHGITHUBURL"));
171
+ }
172
+ }
173
+
147
174
  if (!githubToken) {
148
175
  errors.push(getError("ENOGHTOKEN", { owner, repo }));
149
176
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semantic-release/github",
3
3
  "description": "semantic-release plugin to publish a GitHub release and comment on released Pull Requests/Issues",
4
- "version": "10.1.0",
4
+ "version": "10.1.2",
5
5
  "type": "module",
6
6
  "author": "Pierre Vanduynslager (https://twitter.com/@pvdlg_)",
7
7
  "ava": {
@@ -48,8 +48,8 @@
48
48
  "lockfile-lint": "4.14.0",
49
49
  "ls-engines": "0.9.2",
50
50
  "npm-run-all2": "6.2.2",
51
- "prettier": "3.3.2",
52
- "publint": "0.2.8",
51
+ "prettier": "3.3.3",
52
+ "publint": "0.2.9",
53
53
  "semantic-release": "24.0.0",
54
54
  "sinon": "18.0.0",
55
55
  "tempy": "3.1.0"
@@ -127,5 +127,5 @@
127
127
  "github>semantic-release/.github:renovate-config"
128
128
  ]
129
129
  },
130
- "packageManager": "npm@10.8.1"
130
+ "packageManager": "npm@10.8.2"
131
131
  }