From e74e43dbad149976859836aec58ec6d1fa332208 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tancr=C3=A8de=20SUARD?= Date: Tue, 24 Jan 2023 16:30:34 +0100 Subject: [PATCH 1/2] Fix API body format --- README.md | 2 +- app/adapters/gitlab.js | 2 +- package-lock.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ab79c4a..171f9d7 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ A Gitlab release note generator that generates release note on latest tag 5. Generate a release note/changelog based on the findings above. ## Software requirement -- NodeJS ^10.x.x OR docker +- NodeJS ^16.x.x OR docker - A gitlab personal access token with `api` permission. [How to Tutorial](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html) ## How to run this app diff --git a/app/adapters/gitlab.js b/app/adapters/gitlab.js index 1733d5b..4cf0501 100644 --- a/app/adapters/gitlab.js +++ b/app/adapters/gitlab.js @@ -94,7 +94,7 @@ module.exports = class GitlabAdapter { async createTagReleaseByProjectIdTagNameAndTagId(projectId, tagName, body) { const response = await Got.post(`${this.GITLAB_API_ENDPOINT}/projects/${projectId}/releases`, { ...this.gotDefaultOptions, - json: { ...body, tagName } + json: { ...body, tag_name: tagName } }); return response.body; } diff --git a/package-lock.json b/package-lock.json index ab5fe3c..e3584c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "faker": "5.5.3", "jest": "27.5.1", "jest-when": "3.5.1", - "mockdate": "^3.0.5", + "mockdate": "3.0.5", "nock": "13.2.4", "prettier": "2.6.1" }, From 8ca4517d9bbb37bf1186abfaa88a44b0ff6bd2bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tancr=C3=A8de=20SUARD?= Date: Tue, 24 Jan 2023 17:14:00 +0100 Subject: [PATCH 2/2] Fix checking env vars --- app/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/index.js b/app/index.js index 06ce770..e211f97 100644 --- a/app/index.js +++ b/app/index.js @@ -10,7 +10,7 @@ const container = ConfigureContainer(); (async () => { try { let env = null; - if (process.env.GITLAB_API_ENDPOINT && process.env.GITLAB_PROJECT_ID) { + if (process.env.GITLAB_PERSONAL_TOKEN && process.env.GITLAB_PROJECT_ID) { // eslint-disable-next-line no-console console.log(`Detected environment variable. Skipping CLI command.`); env = process.env;