@hexonet/semantic-release-whmcs 5.0.57 → 5.0.59

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.
package/HISTORY.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [5.0.59](https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-whmcs/compare/v5.0.58...v5.0.59) (2025-03-18)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **error.js:** EWHMCSNOCREDENTIALS details env var names ([daf71d3](https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-whmcs/commit/daf71d37085917abb61916dfbdcc37483340e82a))
7
+
8
+ ## [5.0.58](https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-whmcs/compare/v5.0.57...v5.0.58) (2025-03-10)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **get-github-releases.js:** replace github-api with @octokit/rest for GitHub releases ([b68559b](https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-whmcs/commit/b68559b927fce7c8d35c89d7987218efac698fb8))
14
+
1
15
  ## [5.0.57](https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-whmcs/compare/v5.0.56...v5.0.57) (2025-03-10)
2
16
 
3
17
 
package/README.md CHANGED
@@ -32,7 +32,7 @@ FYI: This module is ESM ready!
32
32
  ### Install
33
33
 
34
34
  ```bash
35
- > npm i semantic-release-whmcs -D
35
+ > npm i @hexonet/semantic-release-whmcs -D
36
36
  ```
37
37
 
38
38
  ### Configuration
@@ -44,7 +44,7 @@ The plugin can be loaded in the [**semantic-release** configuration file](https:
44
44
  "plugins": [
45
45
  "@semantic-release/commit-analyzer",
46
46
  "@semantic-release/release-notes-generator",
47
- "semantic-release-whmcs"
47
+ "@hexonet/semantic-release-whmcs"
48
48
  ]
49
49
  }
50
50
  ```
@@ -55,7 +55,7 @@ With this example product/module versions will be published to the [WHMCS Market
55
55
 
56
56
  The WHMCS Marketplace authentication configuration is **required** and can be set via [environment variables](#environment-variables).
57
57
 
58
- If you don't have an WHMCS Marketplace account yet, please create one. The credentials have to be made available in your CI environment via the `WHMCSMP_LOGIN` and `WHMCSMP_PASSWORD` environment variables. The account must have access to the product(s) you want to publish new versions for.
58
+ If you don't have a WHMCS Marketplace account yet, please create one. The credentials have to be made available in your CI environment via the `WHMCSMP_LOGIN` and `WHMCSMP_PASSWORD` environment variables. The account must have access to the product(s) you want to publish new versions for.
59
59
 
60
60
  ### WHMCS Marketplace Product ID
61
61
 
@@ -9,7 +9,7 @@ export function EWHMCSNOCREDENTIALS() {
9
9
  return {
10
10
  message: "No WHMCS Marketplace credentials specified.",
11
11
  details:
12
- "WHMCS Marketplace credentails have to be set in the `WHMCS_LOGIN` and `WHMCS_PASSWORD` environment variables on your CI environment.",
12
+ "WHMCS Marketplace credentials have to be set in the `WHMCSMP_LOGIN` and `WHMCSMP_PASSWORD` environment variables in your CI environment.",
13
13
  };
14
14
  }
15
15
 
@@ -1,11 +1,8 @@
1
1
  import resolveConfig from "./resolve-config.js";
2
- import GitHub from "github-api";
2
+ import { Octokit } from "@octokit/rest";
3
3
  import debugConfig from "debug";
4
4
  const debug = debugConfig("semantic-release:whmcs");
5
5
 
6
- // https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting
7
- // Rate limits to 60 requests/hour per IP for anonymous requests, 5000/hour with authentication
8
-
9
6
  /**
10
7
  * A method to get releases from github repository
11
8
  */
@@ -14,19 +11,26 @@ export default async (pluginConfig, context) => {
14
11
 
15
12
  const { ghrepo, ghtoken } = resolveConfig(context);
16
13
 
17
- const gh = new GitHub({
18
- token: ghtoken,
14
+ const octokit = new Octokit({
15
+ auth: ghtoken,
19
16
  });
17
+
20
18
  if (ghrepo) {
21
- // optional by default false
22
- const repo = ghrepo.split("/");
23
- const githubReleases = await gh.getRepo(repo[0], repo[1]).listReleases();
24
- if (githubReleases.status === 200) {
25
- githubReleases.data.forEach((r) => debug(`Detected GitHub release ${r.name.substring(1)}`));
26
- githubReleases.data.reverse();
27
- return githubReleases.data;
19
+ const [owner, repo] = ghrepo.split("/");
20
+ try {
21
+ const githubReleases = await octokit.repos.listReleases({
22
+ owner,
23
+ repo,
24
+ });
25
+
26
+ if (githubReleases.status === 200) {
27
+ githubReleases.data.forEach((r) => debug(`Detected GitHub release ${r.name.substring(1)}`));
28
+ githubReleases.data.reverse();
29
+ return githubReleases.data;
30
+ }
31
+ } catch (error) {
32
+ debug("Failed to get releases from GitHub", error);
28
33
  }
29
- debug("Failed to get releases from GitHub");
30
34
  }
31
35
  return false;
32
36
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hexonet/semantic-release-whmcs",
3
3
  "description": "`semantic-release` plugin for auto-publishing on WHMCS marketplace",
4
- "version": "5.0.57",
4
+ "version": "5.0.59",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "publishConfig": {
@@ -68,7 +68,6 @@
68
68
  "overrides": {
69
69
  "http-cache-semantics": "^4.1.1",
70
70
  "word-wrap": "npm:@aashutoshrathi/word-wrap@1.2.6",
71
- "axios": "^1.8.2",
72
71
  "glob-parent": "^5.1.2"
73
72
  },
74
73
  "devDependencies": {
@@ -83,10 +82,10 @@
83
82
  "stream-buffers": "^3.0.2"
84
83
  },
85
84
  "dependencies": {
85
+ "@octokit/rest": "^21.1.1",
86
86
  "@semantic-release/error": "^4.0.0",
87
87
  "aggregate-error": "^5.0.0",
88
88
  "debug": "^4.3.4",
89
- "github-api": "^3.4.0",
90
89
  "puppeteer": ">=23.4.0",
91
90
  "yargs": "^17.7.1"
92
91
  }