mirror of
https://github.com/cycjimmy/semantic-release-action.git
synced 2025-11-07 10:46:56 +00:00
Merge pull request #198 from mym0404/patch-1
feat: add repository_url input
This commit is contained in:
commit
525a3af78a
5 changed files with 26 additions and 3 deletions
|
|
@ -53,7 +53,8 @@ then make sure that you configure this in your `package.json` file:
|
||||||
| ci | false | Whether to run semantic release with CI support. [[Details](#ci)]<br>Support for **semantic-release above v16**. |
|
| ci | false | Whether to run semantic release with CI support. [[Details](#ci)]<br>Support for **semantic-release above v16**. |
|
||||||
| extends | false | Use a sharable configuration [[Details](#extends)] |
|
| extends | false | Use a sharable configuration [[Details](#extends)] |
|
||||||
| working_directory | false | Use another working directory for semantic release [[Details](#working_directory)] |
|
| working_directory | false | Use another working directory for semantic release [[Details](#working_directory)] |
|
||||||
| tag_format | false | Specify format of tag (useful for monorepos) |
|
| tag_format | false | Specify format of tag (useful for monorepos) |
|
||||||
|
| repository_url | false | The Git repository url. If no repository url specified, current repository will be used by default. |
|
||||||
|
|
||||||
#### semantic_version
|
#### semantic_version
|
||||||
> {Optional Input Parameter} Specify version range for semantic-release.
|
> {Optional Input Parameter} Specify version range for semantic-release.
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,9 @@ inputs:
|
||||||
tag_format:
|
tag_format:
|
||||||
required: false
|
required: false
|
||||||
description: 'The default tag format on semantic-release is v{version}. You can override that behavior using this option.'
|
description: 'The default tag format on semantic-release is v{version}. You can override that behavior using this option.'
|
||||||
|
repository_url:
|
||||||
|
required: false
|
||||||
|
description: 'The Git repository url. If no repository url specified, current repository will be used by default.'
|
||||||
outputs:
|
outputs:
|
||||||
new_release_published:
|
new_release_published:
|
||||||
description: 'Whether a new release was published'
|
description: 'Whether a new release was published'
|
||||||
|
|
|
||||||
|
|
@ -116,3 +116,18 @@ exports.handleTagFormat = () => {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle repository-url Option
|
||||||
|
* @returns {{}|{r: String}}
|
||||||
|
*/
|
||||||
|
exports.handleRepositoryUrlOption = () => {
|
||||||
|
const repositoryUrl = core.getInput(inputs.repository_url);
|
||||||
|
core.debug(`repository_url input: ${repositoryUrl}`);
|
||||||
|
|
||||||
|
if (repositoryUrl) {
|
||||||
|
return { r: repositoryUrl };
|
||||||
|
} else {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { handleRepositoryUrlOption } from './handleOptions';
|
||||||
|
|
||||||
const core = require('@actions/core');
|
const core = require('@actions/core');
|
||||||
const {
|
const {
|
||||||
handleBranchesOption,
|
handleBranchesOption,
|
||||||
|
|
@ -32,7 +34,8 @@ const release = async () => {
|
||||||
...handleDryRunOption(),
|
...handleDryRunOption(),
|
||||||
...handleCiOption(),
|
...handleCiOption(),
|
||||||
...handleExtends(),
|
...handleExtends(),
|
||||||
...handleTagFormat()
|
...handleTagFormat(),
|
||||||
|
...handleRepositoryUrlOption()
|
||||||
});
|
});
|
||||||
|
|
||||||
await cleanupNpmrc();
|
await cleanupNpmrc();
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,6 @@
|
||||||
"ci": "ci",
|
"ci": "ci",
|
||||||
"extends": "extends",
|
"extends": "extends",
|
||||||
"working_directory": "working_directory",
|
"working_directory": "working_directory",
|
||||||
"tag_format": "tag_format"
|
"tag_format": "tag_format",
|
||||||
|
"repository_url": "repository_url"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue