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

feat: Allow for custom types #53

Merged
merged 14 commits into from
Oct 21, 2020
Merged

feat: Allow for custom types #53

merged 14 commits into from
Oct 21, 2020

Conversation

amannn
Copy link
Owner

@amannn amannn commented Oct 19, 2020

Based on #47 and #52.

It seems there are some issues with running the latest changes from a branch within a PR workflow, therefore I opened another PR which contains the relevant changes from #47 and #52.

The new behaviour can for example be seen here: https://github.com/amannn/action-semantic-pull-request/runs/1273430601

Resolves #39
Resolves #45
Closes #47
Closes #52

@amannn amannn closed this Oct 19, 2020
@amannn amannn reopened this Oct 19, 2020
@@ -1,6 +1,6 @@
name: 'Lint PR title'
on:
pull_request_target:
pull_request:
Copy link
Owner Author

@amannn amannn Oct 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed this to run checks against this branch. It seems like this only works properly when it's the owner making the PR.

# Optionally you can configure which types are allowed.
# Default: https://github.com/commitizen/conventional-commit-types
with:
types: fix, feat
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a string, as Github Actions doesn't support array arguments currently.

@@ -7,3 +7,6 @@ runs:
branding:
icon: 'shield'
color: 'green'
inputs:
types:
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conventional commits calls these "types", therefore I'd go for the same terminology.

@amannn amannn changed the title feat: Custom types feat: Allow for custom types Oct 19, 2020
const {parserOpts} = await conventionalCommitsConfig();
const result = parser(prTitle, parserOpts);

function printAvailableTypes() {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sneaked in another improvement here: #45

Copy link

@alorma alorma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work!

@alorma
Copy link

alorma commented Oct 20, 2020

Hey @amannn Will you merge this?

@amannn amannn merged commit 2fe39e2 into master Oct 21, 2020
@amannn
Copy link
Owner Author

amannn commented Oct 21, 2020

@alorma Yep, I've just published v2.1.0 which contains this feature. I've mentioned you in the changelog for your contribution. Thank you very much for your work!

@amannn amannn deleted the custom-types branch October 21, 2020 06:56
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 this pull request may close these issues.

Upon failure, report available options Support custom tags
2 participants