Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings assets to false results in error #280

Open
bestickley opened this issue Jul 21, 2021 · 2 comments · May be fixed by #402
Open

Settings assets to false results in error #280

bestickley opened this issue Jul 21, 2021 · 2 comments · May be fixed by #402

Comments

@bestickley
Copy link

With this .releaserc.js:

module.exports = {
  branches: ["main"],
  plugins: [
    "@semantic-release/commit-analyzer", // analyzes commits with conventional-changelog standrd
    "@semantic-release/release-notes-generator", // generates changelog content based on conventional-changelog standard
    "@semantic-release/changelog", // updates CHANGELOG.md
    "@semantic-release/npm", // updates version in package.json based on commits
    ["@semantic-release/git", { assets: false }],
  ],
};

I get this error:

[3:43:47 PM] [semantic-release] › ✖  An error occurred while running semantic-release: TypeError: assets.map is not a function
--
130 | at module.exports (/codebuild/output/src038058146/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/gb-static-site/node_modules/@semantic-release/git/lib/prepare.js:37:14)
131 | at processTicksAndRejections (internal/process/task_queues.js:93:5)
132 | at async prepare (/codebuild/output/src038058146/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/gb-static-site/node_modules/@semantic-release/git/index.js:28:3)
133 | at async validator (/codebuild/output/src038058146/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/gb-static-site/node_modules/semantic-release/lib/plugins/normalize.js:34:24)
134 | at async /codebuild/output/src038058146/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/gb-static-site/node_modules/semantic-release/lib/plugins/pipeline.js:37:34
135 | at async /codebuild/output/src038058146/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/gb-static-site/node_modules/semantic-release/lib/plugins/pipeline.js:31:3
136 | at async Object.pluginsConf.<computed> [as prepare] (/codebuild/output/src038058146/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/gb-static-site/node_modules/semantic-release/lib/plugins/index.js:80:11)
137 | at async run (/codebuild/output/src038058146/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/gb-static-site/node_modules/semantic-release/index.js:185:3)
138 | at async module.exports (/codebuild/output/src038058146/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/gb-static-site/node_modules/semantic-release/index.js:260:22)
139 | at async module.exports (/codebuild/output/src038058146/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/gb-static-site/node_modules/semantic-release/cli.js:55:5) {
140 | pluginName: '@semantic-release/git'
141 | }
142 | TypeError: assets.map is not a function
143 | at module.exports (/codebuild/output/src038058146/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/gb-static-site/node_modules/@semantic-release/git/lib/prepare.js:37:14)
144 | at processTicksAndRejections (internal/process/task_queues.js:93:5)
145 | at async prepare (/codebuild/output/src038058146/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/gb-static-site/node_modules/@semantic-release/git/index.js:28:3)
146 | at async validator (/codebuild/output/src038058146/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/gb-static-site/node_modules/semantic-release/lib/plugins/normalize.js:34:24)
147 | at async /codebuild/output/src038058146/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/gb-static-site/node_modules/semantic-release/lib/plugins/pipeline.js:37:34
148 | at async /codebuild/output/src038058146/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/gb-static-site/node_modules/semantic-release/lib/plugins/pipeline.js:31:3
149 | at async Object.pluginsConf.<computed> [as prepare] (/codebuild/output/src038058146/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/gb-static-site/node_modules/semantic-release/lib/plugins/index.js:80:11)
150 | at async run (/codebuild/output/src038058146/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/gb-static-site/node_modules/semantic-release/index.js:185:3)
151 | at async module.exports (/codebuild/output/src038058146/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/gb-static-site/node_modules/semantic-release/index.js:260:22)
152 | at async module.exports (/codebuild/output/src038058146/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/gb-static-site/node_modules/semantic-release/cli.js:55:5) {
153 | pluginName: '@semantic-release/git'
154 | }

Is the documentation wrong? Docs say I should be able to set assets to false.

@liemdo
Copy link

liemdo commented Aug 6, 2021

I get the same error as well.

@micalevisk
Copy link

micalevisk commented Feb 2, 2022

The issue is that here:

assets.map(asset => (!isArray(asset) && isPlainObject(asset) ? asset.path : asset)),

isn't expected that assets could be false, as allowed here:

: assets
? castArray(assets)
: assets,

image

A simple change like:

- const filesToCommit = uniq(
+ const filesToCommit = !assets ? [] : uniq(

here:

const filesToCommit = uniq(

should fix it, I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants