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

...

9 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
Geoffrey.C
8e71605483
Merge pull request #261 from cycjimmy/dependabot/npm_and_yarn/semantic-release-24.2.9
build(deps): bump semantic-release from 24.2.7 to 24.2.9
2025-10-03 01:43:16 +08:00
dependabot[bot]
d0147331ab
build(deps): bump semantic-release from 24.2.7 to 24.2.9
Bumps [semantic-release](https://github.com/semantic-release/semantic-release) from 24.2.7 to 24.2.9.
- [Release notes](https://github.com/semantic-release/semantic-release/releases)
- [Commits](https://github.com/semantic-release/semantic-release/compare/v24.2.7...v24.2.9)

---
updated-dependencies:
- dependency-name: semantic-release
  dependency-version: 24.2.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-22 00:01:13 +00:00
Geoffrey.C
8f46764b73
Merge pull request #257 from cycjimmy/dependabot/github_actions/actions/setup-node-5
build(deps): bump actions/setup-node from 4 to 5
2025-09-05 17:00:40 +08:00
dependabot[bot]
cc1a3d73b8
build(deps): bump actions/setup-node from 4 to 5
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4 to 5.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-05 00:01:30 +00:00
Geoffrey.C
c868a78cfc docs: update the actions version in the README (#255) 2025-09-04 16:20:38 +08:00
6 changed files with 74 additions and 60 deletions

View file

@ -46,7 +46,7 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Setup Node.js with GitHub Package Registry
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: 24
registry-url: 'https://npm.pkg.github.com'

View file

@ -18,16 +18,16 @@ GitHub Action for [Semantic Release][semantic-url].
```yaml
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
uses: cycjimmy/semantic-release-action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
```
**IMPORTANT**: `GITHUB_TOKEN` does not have the required permissions to operate on protected branches.
If you are using this action for protected branches, replace `GITHUB_TOKEN` with [Personal Access Token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). If using the `@semantic-release/git` plugin for protected branches, avoid persisting credentials as part of `actions/checkout@v4` by setting the parameter `persist-credentials: false`. This credential does not have the required permission to operate on protected branches.
If you are using this action for protected branches, replace `GITHUB_TOKEN` with [Personal Access Token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). If using the `@semantic-release/git` plugin for protected branches, avoid persisting credentials as part of `actions/checkout@v5` by setting the parameter `persist-credentials: false`. This credential does not have the required permission to operate on protected branches.
#### Private Packages
@ -63,9 +63,9 @@ then make sure that you configure this in your `package.json` file:
```yaml
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
uses: cycjimmy/semantic-release-action@v5
with:
semantic_version: 19.0.5 # It is recommended to specify a version range
# for semantic-release when using
@ -75,7 +75,7 @@ steps:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
```
If no version range is specified with `cycjimmy/semantic-release-action@v4` then [semantic-release](https://github.com/semantic-release/semantic-release/) version [21.1.1](https://github.com/semantic-release/semantic-release/releases/tag/v21.1.1) is used.
If no version range is specified with `cycjimmy/semantic-release-action@v5` then [semantic-release](https://github.com/semantic-release/semantic-release/) version [24.2.7](https://github.com/semantic-release/semantic-release/releases/tag/v24.2.7) is used.
#### branches
> {Optional Input Parameter} The branches on which releases should happen.<br>`branches` supports for **semantic-release above v16**.
@ -83,9 +83,9 @@ If no version range is specified with `cycjimmy/semantic-release-action@v4` then
```yaml
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
uses: cycjimmy/semantic-release-action@v5
with:
semantic_version: 16
# you can set branches for semantic-release above v16.
@ -129,9 +129,9 @@ See [configuration#branches](https://semantic-release.gitbook.io/semantic-releas
```yaml
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
uses: cycjimmy/semantic-release-action@v5
with:
semantic_version: 15.13.28
# you can set branch for semantic-release older than v16.
@ -154,9 +154,9 @@ Github Action Workflow:
```yaml
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
uses: cycjimmy/semantic-release-action@v5
with:
# You can specify specifying version range for the extra plugins if you prefer.
extra_plugins: |
@ -184,9 +184,9 @@ Release Config:
```yaml
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
uses: cycjimmy/semantic-release-action@v5
with:
dry_run: true
env:
@ -200,9 +200,9 @@ steps:
```yaml
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
uses: cycjimmy/semantic-release-action@v5
with:
ci: false
env:
@ -218,9 +218,9 @@ The action can be used with `extends` option to extend an existing [sharable con
```yaml
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
uses: cycjimmy/semantic-release-action@v5
with:
# You can extend an existing shareable configuration.
# And you can specify version range for the shareable configuration if you prefer.
@ -238,9 +238,9 @@ This action run semantic release in the github provided workspace by default. Yo
```yaml
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
uses: cycjimmy/semantic-release-action@v5
with:
# You can select another working directory like a subdirectory for example.
working_directory: ./code
@ -255,9 +255,9 @@ The default tag format on semantic-release is `v{version}`. You can override tha
```yaml
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
uses: cycjimmy/semantic-release-action@v5
with:
tag_format: custom-v${version}
env:
@ -271,7 +271,7 @@ Setting this to true will unset the `GITHUB_ACTIONS` environment variable. This
```yaml
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Temporarily merge PR branch
if: ${{ github.event_name == 'pull_request' }}
run: |
@ -279,7 +279,7 @@ steps:
git config --global user.email github-actions@github.com
git merge --no-ff origin/${{ github.event.pull_request.head.ref }} --message "${{ github.event.pull_request.title }}"
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
uses: cycjimmy/semantic-release-action@v5
with:
unset_gha_env: ${{ github.event_name == 'pull_request' }}
ci: ${{ github.event_name == 'pull_request' && false || '' }}
@ -308,9 +308,9 @@ steps:
```yaml
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
uses: cycjimmy/semantic-release-action@v5
id: semantic # Need an `id` for output variables
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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)

53
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": {
@ -1784,11 +1784,11 @@
}
},
"node_modules/hook-std": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/hook-std/-/hook-std-3.0.0.tgz",
"integrity": "sha512-jHRQzjSDzMtFy34AGj1DN+vq54WVuhSvKgrHf0OMiFQTwDD4L/qqofVEWjLOBMTn5+lCD3fPg32W9yOfnEJTTw==",
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/hook-std/-/hook-std-4.0.0.tgz",
"integrity": "sha512-IHI4bEVOt3vRUDJ+bFA9VUJlo7SzvFARPNLw75pqSmAOP2HmTWfFJtPvLBrDrlgjEYXY9zs7SFdHPQaJShkSCQ==",
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
"node": ">=20"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
@ -5296,9 +5296,9 @@
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"node_modules/semantic-release": {
"version": "24.2.7",
"resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-24.2.7.tgz",
"integrity": "sha512-g7RssbTAbir1k/S7uSwSVZFfFXwpomUB9Oas0+xi9KStSCmeDXcA7rNhiskjLqvUe/Evhx8fVCT16OSa34eM5g==",
"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",
@ -5315,7 +5315,7 @@
"find-versions": "^6.0.0",
"get-stream": "^6.0.0",
"git-log-parser": "^1.2.0",
"hook-std": "^3.0.0",
"hook-std": "^4.0.0",
"hosted-git-info": "^8.0.0",
"import-from-esm": "^2.0.0",
"lodash-es": "^4.17.21",
@ -5327,7 +5327,7 @@
"read-package-up": "^11.0.0",
"resolve-from": "^5.0.0",
"semver": "^7.3.2",
"semver-diff": "^4.0.0",
"semver-diff": "^5.0.0",
"signale": "^1.2.1",
"yargs": "^17.5.1"
},
@ -5563,9 +5563,10 @@
}
},
"node_modules/semver-diff": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-4.0.0.tgz",
"integrity": "sha512-0Ju4+6A8iOnpL/Thra7dZsSlOHYAHIeMxfhWQRI1/VLcT3WDBZKKtQt/QkBOsiIN9ZpuvHE6cGZ0x4glCMmfiA==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-5.0.0.tgz",
"integrity": "sha512-0HbGtOm+S7T6NGQ/pxJSJipJvc4DK3FcRVMRkhsIwJDJ4Jcz5DQC1cPPzB5GhzyHjwttW878HaWQq46CkL3cqg==",
"deprecated": "Deprecated as the semver package now supports this built-in.",
"dependencies": {
"semver": "^7.3.5"
},
@ -7371,9 +7372,9 @@
"integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A=="
},
"hook-std": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/hook-std/-/hook-std-3.0.0.tgz",
"integrity": "sha512-jHRQzjSDzMtFy34AGj1DN+vq54WVuhSvKgrHf0OMiFQTwDD4L/qqofVEWjLOBMTn5+lCD3fPg32W9yOfnEJTTw=="
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/hook-std/-/hook-std-4.0.0.tgz",
"integrity": "sha512-IHI4bEVOt3vRUDJ+bFA9VUJlo7SzvFARPNLw75pqSmAOP2HmTWfFJtPvLBrDrlgjEYXY9zs7SFdHPQaJShkSCQ=="
},
"hosted-git-info": {
"version": "7.0.1",
@ -9660,9 +9661,9 @@
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"semantic-release": {
"version": "24.2.7",
"resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-24.2.7.tgz",
"integrity": "sha512-g7RssbTAbir1k/S7uSwSVZFfFXwpomUB9Oas0+xi9KStSCmeDXcA7rNhiskjLqvUe/Evhx8fVCT16OSa34eM5g==",
"version": "24.2.9",
"resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-24.2.9.tgz",
"integrity": "sha512-phCkJ6pjDi9ANdhuF5ElS10GGdAKY6R1Pvt9lT3SFhOwM4T7QZE7MLpBDbNruUx/Q3gFD92/UOFringGipRqZA==",
"requires": {
"@semantic-release/commit-analyzer": "^13.0.0-beta.1",
"@semantic-release/error": "^4.0.0",
@ -9678,7 +9679,7 @@
"find-versions": "^6.0.0",
"get-stream": "^6.0.0",
"git-log-parser": "^1.2.0",
"hook-std": "^3.0.0",
"hook-std": "^4.0.0",
"hosted-git-info": "^8.0.0",
"import-from-esm": "^2.0.0",
"lodash-es": "^4.17.21",
@ -9690,7 +9691,7 @@
"read-package-up": "^11.0.0",
"resolve-from": "^5.0.0",
"semver": "^7.3.2",
"semver-diff": "^4.0.0",
"semver-diff": "^5.0.0",
"signale": "^1.2.1",
"yargs": "^17.5.1"
},
@ -9838,9 +9839,9 @@
}
},
"semver-diff": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-4.0.0.tgz",
"integrity": "sha512-0Ju4+6A8iOnpL/Thra7dZsSlOHYAHIeMxfhWQRI1/VLcT3WDBZKKtQt/QkBOsiIN9ZpuvHE6cGZ0x4glCMmfiA==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-5.0.0.tgz",
"integrity": "sha512-0HbGtOm+S7T6NGQ/pxJSJipJvc4DK3FcRVMRkhsIwJDJ4Jcz5DQC1cPPzB5GhzyHjwttW878HaWQq46CkL3cqg==",
"requires": {
"semver": "^7.3.5"
}

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.`);