Skip to content

Commit

Permalink
Merge pull request #117 from mKeRix/feat/extends-versions
Browse files Browse the repository at this point in the history
feat: handle versioned extends inputs correctly
  • Loading branch information
cycjimmy authored Aug 5, 2022
2 parents ccac674 + e1ef975 commit f3d7b21
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
6 changes: 5 additions & 1 deletion src/handleOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {};
}
Expand Down

0 comments on commit f3d7b21

Please sign in to comment.