5
0
Fork 0
mirror of https://github.com/cycjimmy/semantic-release-action.git synced 2025-11-07 10:46:56 +00:00

Compare commits

..

4 commits

Author SHA1 Message Date
semantic-release-bot
ebcbc66374 chore(release): 5.0.1 [skip ci]
## [5.0.1](https://github.com/cycjimmy/semantic-release-action/compare/v5.0.0...v5.0.1) (2025-10-09)

### Bug Fixes

* improves result handling in windUpJob.task.js ([4267eee](4267eee560))
2025-10-09 10:13:01 +00:00
Geoffrey.C
79d9929b57
Merge pull request #262 from mgerlach/patch-1
fix: improves result handling in windUpJob.task.js
2025-10-09 18:12:42 +08:00
Martin Gerlach
2d054a5550
chore: remove whitespace 2025-10-09 02:34:54 +02:00
Martin Gerlach
4267eee560
fix: improves result handling in windUpJob.task.js
Promise was checked before resolving, so the first early return never happened (Promises are truthy) and the subsequent `if (lastRelease.version)` check produced an error in some cases(`lastRelease` undefined, "Error: TypeError: Cannot read properties of undefined (reading 'version')"). 

Observed for semantic-release-action 4.2.2 and 5.0.0 with semantic_version > 24.2.6 (not observed with 24.2.6). 

The PR prevents reading properties of "undefined".
2025-10-09 02:31:05 +02:00
4 changed files with 24 additions and 10 deletions

View file

@ -1,3 +1,10 @@
## [5.0.1](https://github.com/cycjimmy/semantic-release-action/compare/v5.0.0...v5.0.1) (2025-10-09)
### Bug Fixes
* improves result handling in windUpJob.task.js ([4267eee](https://github.com/cycjimmy/semantic-release-action/commit/4267eee56034cc3ee6f2fef9bdc3cc125ca073db))
# [5.0.0](https://github.com/cycjimmy/semantic-release-action/compare/v4.2.2...v5.0.0) (2025-08-30)

7
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "@cycjimmy/semantic-release-action",
"version": "5.0.0",
"version": "5.0.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@cycjimmy/semantic-release-action",
"version": "5.0.0",
"version": "5.0.1",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.10.1",
@ -14,7 +14,7 @@
"@cycjimmy/awesome-js-funcs": "^4.0.9",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"semantic-release": "^24.2.7"
"semantic-release": "^24.2.9"
}
},
"node_modules/@actions/core": {
@ -5299,6 +5299,7 @@
"version": "24.2.9",
"resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-24.2.9.tgz",
"integrity": "sha512-phCkJ6pjDi9ANdhuF5ElS10GGdAKY6R1Pvt9lT3SFhOwM4T7QZE7MLpBDbNruUx/Q3gFD92/UOFringGipRqZA==",
"license": "MIT",
"dependencies": {
"@semantic-release/commit-analyzer": "^13.0.0-beta.1",
"@semantic-release/error": "^4.0.0",

View file

@ -1,6 +1,6 @@
{
"name": "@cycjimmy/semantic-release-action",
"version": "5.0.0",
"version": "5.0.1",
"description": "GitHub Action for Semantic Release",
"main": "index.js",
"scripts": {
@ -26,6 +26,6 @@
"@cycjimmy/awesome-js-funcs": "^4.0.9",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"semantic-release": "^24.2.7"
"semantic-release": "^24.2.9"
}
}

View file

@ -7,14 +7,20 @@ const outputs = require('./outputs.json');
* @returns {Promise<void>}
*/
module.exports = async (result) => {
if (!result) {
const resolved = await result;
if (!resolved) {
core.debug('No release published.');
return Promise.resolve();
return;
}
const {lastRelease, commits, nextRelease, releases} = await result;
const {
lastRelease = {},
commits = [],
nextRelease = {},
releases = [],
} = resolved;
if (lastRelease.version) {
if (lastRelease?.version) {
core.debug(`The last release was "${lastRelease.version}".`);
core.setOutput(outputs.last_release_version, lastRelease.version);
core.setOutput(outputs.last_release_git_head, lastRelease.gitHead);
@ -23,7 +29,7 @@ module.exports = async (result) => {
if (!nextRelease) {
core.debug('No release published.');
return Promise.resolve();
return;
}
core.debug(`Published ${nextRelease.type} release version ${nextRelease.version} containing ${commits.length} commits.`);