@cycjimmy/semantic-release-action 3.3.0 → 3.4.1

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/README.md CHANGED
@@ -50,6 +50,7 @@ then make sure that you configure this in your `package.json` file:
50
50
  | branch | false | The branch on which releases should happen.[[Details](#branch)]<br>Only support for **semantic-release older than v16**. |
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
+ | ci | false | Whether to run semantic release with CI support. [[Details](#ci)]<br>Support for **semantic-release above v16**. |
53
54
  | extends | false | Use a sharable configuration [[Details](#extends)] |
54
55
  | working_directory | false | Use another working directory for semantic release [[Details](#working_directory)] |
55
56
  | tag_format | false | Specify format of tag (useful for monorepos) |
@@ -193,6 +194,24 @@ steps:
193
194
  NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
194
195
  ```
195
196
 
197
+ #### ci
198
+ > {Optional Input Parameter} Whether to run semantic release with CI support (default true).<br>`ci` supports for **semantic-release above v16**.
199
+
200
+ ```yaml
201
+ steps:
202
+ - name: Checkout
203
+ uses: actions/checkout@v3
204
+ - name: Semantic Release
205
+ uses: cycjimmy/semantic-release-action@v3
206
+ with:
207
+ ci: false
208
+ env:
209
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
210
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
211
+ ```
212
+
213
+ `ci` can be used, e.g in combination with `dry_run` when generating the next release version in pull requests, where `semantic_release` would normally block the execution.
214
+
196
215
  #### extends
197
216
  The action can be used with `extends` option to extend an existing [sharable configuration](https://semantic-release.gitbook.io/semantic-release/usage/shareable-configurations) of semantic-release. Can be used in combination with `extra_plugins`.
198
217
 
package/action.yml CHANGED
@@ -20,6 +20,9 @@ inputs:
20
20
  dry_run:
21
21
  required: false
22
22
  description: 'Whether to run semantic release in `dry-run` mode. It will override the dryRun attribute in your configuration file'
23
+ ci:
24
+ required: false
25
+ description: 'Whether to run semantic release with CI support (default: true). It will override the ci attribute in your configuration file'
23
26
  extends:
24
27
  required: false
25
28
  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
+ ## [3.4.1](https://github.com/cycjimmy/semantic-release-action/compare/v3.4.0...v3.4.1) (2023-03-30)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **windUpJob:** set last_release outputs before returning ([91e3dc6](https://github.com/cycjimmy/semantic-release-action/commit/91e3dc6dcc39e4b462a165d85338c4e6cf1db9b6))
7
+
8
+ # [3.4.0](https://github.com/cycjimmy/semantic-release-action/compare/v3.3.0...v3.4.0) (2023-03-15)
9
+
10
+
11
+ ### Features
12
+
13
+ * add `ci` input parameter ([b356b18](https://github.com/cycjimmy/semantic-release-action/commit/b356b18b5f474bb4b9fe4bb5801b364ce24aa8f6))
14
+
1
15
  # [3.3.0](https://github.com/cycjimmy/semantic-release-action/compare/v3.2.0...v3.3.0) (2023-03-07)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cycjimmy/semantic-release-action",
3
- "version": "3.3.0",
3
+ "version": "3.4.1",
4
4
  "description": "GitHub Action for Semantic Release",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -23,7 +23,7 @@
23
23
  "dependencies": {
24
24
  "@actions/core": "^1.10.0",
25
25
  "@cycjimmy/awesome-js-funcs": "^4.0.4",
26
- "@semantic-release/changelog": "^6.0.2",
26
+ "@semantic-release/changelog": "^6.0.3",
27
27
  "@semantic-release/git": "^10.0.1",
28
28
  "semantic-release": "^19.0.5"
29
29
  }
@@ -60,6 +60,25 @@ exports.handleDryRunOption = () => {
60
60
  }
61
61
  };
62
62
 
63
+ /**
64
+ * Handle Ci Option
65
+ * @returns {{}|{ci: boolean}}
66
+ */
67
+ exports.handleCiOption = () => {
68
+ const ci = core.getInput(inputs.ci);
69
+
70
+ switch (ci) {
71
+ case 'true':
72
+ return { ci: true, noCi: false };
73
+
74
+ case 'false':
75
+ return { ci: false, noCi: true };
76
+
77
+ default:
78
+ return {};
79
+ }
80
+ };
81
+
63
82
  /**
64
83
  * Handle Extends Option
65
84
  * @returns {{}|{extends: Array}|{extends: String}}
package/src/index.js CHANGED
@@ -2,6 +2,7 @@ const core = require('@actions/core');
2
2
  const {
3
3
  handleBranchesOption,
4
4
  handleDryRunOption,
5
+ handleCiOption,
5
6
  handleExtends,
6
7
  handleTagFormat,
7
8
  } = require('./handleOptions');
@@ -29,6 +30,7 @@ const release = async () => {
29
30
  const result = await semanticRelease({
30
31
  ...handleBranchesOption(),
31
32
  ...handleDryRunOption(),
33
+ ...handleCiOption(),
32
34
  ...handleExtends(),
33
35
  ...handleTagFormat()
34
36
  });
package/src/inputs.json CHANGED
@@ -4,6 +4,7 @@
4
4
  "branch": "branch",
5
5
  "extra_plugins": "extra_plugins",
6
6
  "dry_run": "dry_run",
7
+ "ci": "ci",
7
8
  "extends": "extends",
8
9
  "working_directory": "working_directory",
9
10
  "tag_format": "tag_format"
@@ -12,8 +12,9 @@ module.exports = async extras => {
12
12
  }
13
13
 
14
14
  const _extras = extras.replace(/['"]/g, '').replace(/[\n\r]/g, ' ');
15
+ const silentFlag = process.env.RUNNER_DEBUG == '1' ? '' : '--silent';
15
16
 
16
- const { stdout, stderr } = await exec(`npm install ${_extras} --silent`, {
17
+ const { stdout, stderr } = await exec(`npm install ${_extras} ${silentFlag}`, {
17
18
  cwd: path.resolve(__dirname, '..')
18
19
  });
19
20
  core.debug(stdout);
@@ -16,7 +16,9 @@ module.exports = async (result) => {
16
16
 
17
17
  if (lastRelease.version) {
18
18
  core.debug(`The last release was "${lastRelease.version}".`);
19
- core.setOutput(outputs.last_release_version, lastRelease.version)
19
+ core.setOutput(outputs.last_release_version, lastRelease.version);
20
+ core.setOutput(outputs.last_release_git_head, lastRelease.gitHead);
21
+ core.setOutput(outputs.last_release_git_tag, lastRelease.gitTag);
20
22
  }
21
23
 
22
24
  if (!nextRelease) {
@@ -43,7 +45,4 @@ module.exports = async (result) => {
43
45
  core.setOutput(outputs.new_release_notes, notes);
44
46
  core.setOutput(outputs.new_release_git_head, gitHead);
45
47
  core.setOutput(outputs.new_release_git_tag, gitTag);
46
- core.setOutput(outputs.last_release_version, lastRelease.version);
47
- core.setOutput(outputs.last_release_git_head, lastRelease.gitHead);
48
- core.setOutput(outputs.last_release_git_tag, lastRelease.gitTag);
49
48
  };