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 to have a custom configuration per branches #63

Merged
merged 2 commits into from
Feb 1, 2021

Conversation

KillianHmyd
Copy link
Contributor

This could allow to have different behaviours according to the branch from which the release is triggered. For example the following example would allow to have changelog only from lts/* and master branches in two different channels :

[
      "semantic-release-slack-bot",
      {
       "notifyOnSuccess": false,
        "notifyOnFail": false,
        "branchesConfig": [
           {
             "branchPattern": "master",
             "notifyOnSuccess": true,
             "notifyOnFail": true,
             "slackWebhook": "stable-channel",
          },
           {
             "branchPattern": "lts/x",
             "notifyOnSuccess": true,
             "notifyOnFail": true,
             "slackWebhook": "lts-channel",
          }
       ]
      }
    ]

@juliuscc
Copy link
Owner

I have a question. I saw you used micromatch. Is that the same pattern-strategy that is used by semantic-release (see here)? It should work identically I think, as a subtly different behavior would be a large cause of friction for users.

@KillianHmyd
Copy link
Contributor Author

KillianHmyd commented Jan 28, 2021

Yes it is exactly the same 👍 If you check the link they put on glob it redirects to micromatch documentation.
It is also referenced in their package.json and seems to be used to filter the branches here.

README.md Outdated Show resolved Hide resolved
lib/verifyConditions.js Outdated Show resolved Hide resolved
lib/verifyConditions.js Outdated Show resolved Hide resolved
@juliuscc
Copy link
Owner

I've looked through the PR and it's great! You have great tests and I think the implementation is clear. It's also great that you expanded the example in the readme.

If you fix the small spelling/grammatical nitpicks I will merge 👍

@KillianHmyd
Copy link
Contributor Author

I've pushed your suggestions, thanks !
Also we tested it in one of our private repository and it worked well 👍

Co-authored-by: Julius Recep Colliander Celik <julius.cc@hotmail.com>
Copy link
Owner

@juliuscc juliuscc left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks! 👍

@juliuscc juliuscc merged commit cab5394 into juliuscc:master Feb 1, 2021
@juliuscc
Copy link
Owner

juliuscc commented Feb 1, 2021

🎉 This PR is included in version 2.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

2 participants