@cycjimmy/semantic-release-action 4.1.0 → 4.2.0

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2019-2020 cycjimmy
3
+ Copyright (c) 2019-2024 cycjimmy
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -51,6 +51,7 @@ then make sure that you configure this in your `package.json` file:
51
51
  | extra_plugins | false | Extra plugins for pre-install. [[Details](#extra_plugins)] |
52
52
  | dry_run | false | Whether to run semantic release in `dry-run` mode. [[Details](#dry_run)] |
53
53
  | ci | false | Whether to run semantic release with CI support. [[Details](#ci)]<br>Support for **semantic-release above v16**. |
54
+ | unset_gha_env | false | Whether to unset the GITHUB_ACTIONS environment variable. |
54
55
  | extends | false | Use a sharable configuration [[Details](#extends)] |
55
56
  | working_directory | false | Use another working directory for semantic release [[Details](#working_directory)] |
56
57
  | tag_format | false | Specify format of tag (useful for monorepos) |
@@ -264,6 +265,29 @@ steps:
264
265
  NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
265
266
  ```
266
267
 
268
+ #### unset_gha_env
269
+ Setting this to true will unset the `GITHUB_ACTIONS` environment variable. This can be useful when wanting to validate things such as merging of a PR would create a valid release.
270
+
271
+ ```yaml
272
+ steps:
273
+ - name: Checkout
274
+ uses: actions/checkout@v4
275
+ - name: Temporarily merge PR branch
276
+ if: ${{ github.event_name == 'pull_request' }}
277
+ run: |
278
+ git config --global user.name github-actions
279
+ git config --global user.email github-actions@github.com
280
+ git merge --no-ff origin/${{ github.event.pull_request.head.ref }} --message "${{ github.event.pull_request.title }}"
281
+ - name: Semantic Release
282
+ uses: cycjimmy/semantic-release-action@v4
283
+ with:
284
+ unset_gha_env: ${{ github.event_name == 'pull_request' }}
285
+ ci: ${{ github.event_name == 'pull_request' && false || '' }}
286
+ env:
287
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
288
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
289
+ ```
290
+
267
291
  ### Outputs
268
292
  | Output Parameter | Description |
269
293
  |:-------------------------:|-----------------------------------------------------------------------------------------------------------------------------------|
package/action.yml CHANGED
@@ -23,6 +23,9 @@ inputs:
23
23
  ci:
24
24
  required: false
25
25
  description: 'Whether to run semantic release with CI support (default: true). It will override the ci attribute in your configuration file'
26
+ unset_gha_env:
27
+ required: false
28
+ description: 'Whether to unset the GITHUB_ACTIONS environment variable. This can be useful when trying to run semantic-release as part of PR checks.'
26
29
  extends:
27
30
  required: false
28
31
  description: 'One or several sharable configurations, https://semantic-release.gitbook.io/semantic-release/usage/configuration#extends'
package/docs/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [4.2.0](https://github.com/cycjimmy/semantic-release-action/compare/v4.1.1...v4.2.0) (2025-03-14)
2
+
3
+
4
+ ### Features
5
+
6
+ * add ability to unset GITHUB_ACTION env var ([266ea7e](https://github.com/cycjimmy/semantic-release-action/commit/266ea7eb8c90943aa9cddd3b0ed326d5e8784a26))
7
+
8
+ ## [4.1.1](https://github.com/cycjimmy/semantic-release-action/compare/v4.1.0...v4.1.1) (2024-09-25)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * default use semantic-release@24 ([c22487b](https://github.com/cycjimmy/semantic-release-action/commit/c22487b442697d88305e0088215bc9da5b07696d))
14
+
1
15
  # [4.1.0](https://github.com/cycjimmy/semantic-release-action/compare/v4.0.0...v4.1.0) (2024-03-19)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cycjimmy/semantic-release-action",
3
- "version": "4.1.0",
3
+ "version": "4.2.0",
4
4
  "description": "GitHub Action for Semantic Release",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -21,10 +21,10 @@
21
21
  },
22
22
  "homepage": "https://github.com/cycjimmy/semantic-release-action#readme",
23
23
  "dependencies": {
24
- "@actions/core": "^1.10.0",
24
+ "@actions/core": "^1.10.1",
25
25
  "@cycjimmy/awesome-js-funcs": "^4.0.9",
26
26
  "@semantic-release/changelog": "^6.0.3",
27
27
  "@semantic-release/git": "^10.0.1",
28
- "semantic-release": "^23.0.5"
28
+ "semantic-release": "^24.2.3"
29
29
  }
30
30
  }
@@ -126,8 +126,8 @@ exports.handleRepositoryUrlOption = () => {
126
126
  core.debug(`repository_url input: ${repositoryUrl}`);
127
127
 
128
128
  if (repositoryUrl) {
129
- return { r: repositoryUrl };
129
+ return { r: repositoryUrl };
130
130
  } else {
131
131
  return {};
132
132
  }
133
- };
133
+ };
package/src/index.js CHANGED
@@ -27,6 +27,11 @@ const release = async () => {
27
27
  await preInstall(core.getInput(inputs.extra_plugins));
28
28
  await preInstall(core.getInput(inputs.extends));
29
29
 
30
+ if (core.getInput(inputs.unset_gha_env) === 'true') {
31
+ core.debug('Unset GITHUB_ACTIONS environment variable');
32
+ delete process.env.GITHUB_ACTIONS;
33
+ }
34
+
30
35
  const semanticRelease = await import('semantic-release');
31
36
  const result = await semanticRelease.default({
32
37
  ...handleBranchesOption(),
package/src/inputs.json CHANGED
@@ -5,6 +5,7 @@
5
5
  "extra_plugins": "extra_plugins",
6
6
  "dry_run": "dry_run",
7
7
  "ci": "ci",
8
+ "unset_gha_env": "unset_gha_env",
8
9
  "extends": "extends",
9
10
  "working_directory": "working_directory",
10
11
  "tag_format": "tag_format",