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

Merge pull request #117 from mKeRix/feat/extends-versions

feat: handle versioned extends inputs correctly
This commit is contained in:
Geoffrey.C 2022-08-05 10:13:07 +08:00 committed by GitHub
commit f3d7b213ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -200,8 +200,10 @@ steps:
uses: cycjimmy/semantic-release-action@v3
with:
# You can extend an existing shareable configuration.
# And you can specify version range for the shareable configuration if you prefer.
extends: |
@semantic-release/apm-config
@semantic-release/apm-config@^9.0.0
@mycompany/override-config
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

View file

@ -68,7 +68,11 @@ exports.handleExtends = () => {
const extend = core.getInput(inputs.extends);
if (extend) {
return { extends: extend };
const extendModuleNames = extend.split(/\r?\n/)
.map((name) => name.replace(/(?<!^)@.+/, ''))
return {
extends: extendModuleNames
};
} else {
return {};
}