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

Configure plugin through pluginOptions #47

Open
acouvreur opened this issue Jan 29, 2021 · 3 comments
Open

Configure plugin through pluginOptions #47

acouvreur opened this issue Jan 29, 2021 · 3 comments

Comments

@acouvreur
Copy link

The only way to configure the plugin behavior is by passing arguments to the CLI.
I like to work only with a written config and at this moment global flags are only supported through the CLI.

It would be nice to be able to configure them through the json config.

Example:

const config = {
  plugins: [
    '@semantic-release/commit-analyzer',
    '@semantic-release/release-notes-generator',,
    '@semantic-release/changelog',
    [
      '@conveyal/maven-semantic-release',
      {
        skipMavenDeploy: true
      }
    ],
    '@semantic-release/git',
  ],
};
@erzz
Copy link

erzz commented Mar 11, 2021

Oh wow - is this true (and where is THAT documented?) :) That explains why I have been banging my head against a wall for an hour !!

Yes please make it possible to contain the entire configuration in one place!

@acouvreur
Copy link
Author

acouvreur commented Mar 11, 2021

Take the example from the file lib/publish.js

The way options are retrieved is only using the context object.

module.exports = async function publish (pluginConfig, context) {
const {logger, nextRelease, options} = context
printVersion(logger)
if (!options.skipMavenDeploy) {

If you read the semantic-release docs the object context retrieve the CLI, whereas the object pluginConfig is specific to the plugin. You'd also have to extract the config from pluginConfig.

I ended up forking the project and completely cleaning it from the conveyal workflow which is a workflow I do not use.

@acouvreur
Copy link
Author

acouvreur commented Mar 11, 2021

Reading the docs here : https://github.com/semantic-release/semantic-release/blob/master/docs/usage/plugins.md#plugin-options-configuration

It seems that you could put the configuration at the root of your semantic release config file. I remember trying this out, but for some reason, couldn't achieve it.

Please tell me if you successfully achieve it.

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

No branches or pull requests

2 participants