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

[@auto-it/all-contributors] doesn't commit using conventional commits #2349

Open
snebjorn opened this issue Mar 27, 2023 · 5 comments
Open
Labels
enhancement New feature or request

Comments

@snebjorn
Copy link
Contributor

snebjorn commented Mar 27, 2023

Is your feature request related to a problem? Please describe.

The commit message from @auto-it/all-contributors doesn't adhere to conventional commits. The commit message is hard-coded.

'"Update contributors [skip ci]"',

Describe the solution you'd like

I'd like it to use a conventional commit message. This could be configurable via a flag.

{
  plugins: [
    [
      'all-contributors',
      {
        commitUsingConventionalCommits: true,
      },
    ],
}

Describe alternatives you've considered

Alternatively it could be a configurable custom message.

{
  plugins: [
    [
      'all-contributors',
      {
        commitMessage: 'chore(release): update contributors [skip ci]',
      },
    ],
}

Additional context

none

@snebjorn snebjorn added the enhancement New feature or request label Mar 27, 2023
@hipstersmoothie
Copy link
Collaborator

Sound like a good feature to me. Would you like to submit a PR?

@snebjorn
Copy link
Contributor Author

Sorry, I don't think I'll have time ATM. Otherwise I wouldn't mind giving it a look.

@XDRAGON2002
Copy link

@snebjorn @hipstersmoothie was there any update on this? If not, I'd take this up.

@snebjorn
Copy link
Contributor Author

snebjorn commented Oct 1, 2023

@XDRAGON2002 no progress, go ahead 🚀

@XDRAGON2002
Copy link

Hi @snebjorn @hipstersmoothie!

I was working on this issue, and apparently after adding the new option, auto is not able to verify/detect this new field:

image

I can't seem to figure out where I'm going wrong? I've also checked out some other prior PRs doing something similar, and still can't seem to figure out what the cause for this could be.

These are the changes I've made:

const pluginOptions = t.partial({
  /** Usernames to exclude from the contributors */
  exclude: t.array(t.string),
  /** Globs to detect change types by */
  types: t.partial(
    fromEntries(contributionTypes.map((c) => [c, pattern])) as Record<
      Contribution,
      typeof pattern
    >
  ),
  /** Define custom commit message defaults to "Update contributors [skip ci]" */
  commitMessage: t.string,
});
const defaultOptions: IAllContributorsPluginOptions = {
  exclude: botList,
  types: {
    doc: ["**/*.mdx", "**/*.md", "**/docs/**/*", "**/documentation/**/*"],
    example: ["**/*.stories*", "**/*.story.*"],
    infra: ["**/.circle/**/*", "**/.github/**/*", "**/travis.yml"],
    test: ["**/*.test.*", "**/test/**", "**/__tests__/**"],
    code: ["**/src/**/*", "**/lib/**/*", "**/package.json", "**/tsconfig.json"],
  },
  commitMessage: "Update contributors [skip ci]",
};
this.options = {
      exclude: [...(defaultOptions.exclude || []), ...(options.exclude || [])],
      types: { ...defaultOptions.types, ...options.types },
      commitMessage: options.commitMessage || defaultOptions.commitMessage || "",
    };

Any pointers? Thanks!

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

No branches or pull requests

3 participants