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

Add inner commits analysis for squashed commit #2750

Closed
wants to merge 3 commits into from
Closed

Add inner commits analysis for squashed commit #2750

wants to merge 3 commits into from

Conversation

GuiBL4
Copy link

@GuiBL4 GuiBL4 commented Mar 28, 2023

This PR aims to create a new feature for repositories using a squash-and-merge strategy for the commits.

This feature uses the GitHub API to retrieve the inner commits inside a PR that has been squashed-and-merged. Each inner commit contains the conventional message <type>(<scope>): <subject> that has to be analyzed by the semantic-release process.
Thus, the message of the squashed-and-merged PR must follow a guideline and finish by a (#[number]) like :
Some-issue-to-solve (#3)

Here's the structure of a PR with a squash-and-merge strategy :

image

The number inside parenthesis refers to the PR's number used by octokit.request to get the inner commits.

We provide some tests. However, as octokit needs a repository to get the PR, a specific one was created and documented for these tests. This test repository is here.

An option has been added with a flag -s or --squashMerge to use this strategy.

@travi
Copy link
Member

travi commented Mar 31, 2023

as highlighted in our documentation, we recommend avoiding squash when you are making multiple changes like you mention. when your commits are atomic, this type of functionality is unnecessary. we appreciate your effort with this contribution, but please confirm with maintainers that there is interest in the change to save yourself from wasted effort.

in this case, we are not intending to support multiple changes in squashed commits.

@travi travi closed this Mar 31, 2023
@GuiBL4
Copy link
Author

GuiBL4 commented Apr 3, 2023

No problem, we developed this feature for our internal use. However, we will run our fork to be able to use it. Have a nice day.

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.

None yet

2 participants