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

misc: Add Workflow to give merging advice #426

Closed
wants to merge 1 commit into from

Conversation

BobbyRBruce
Copy link
Member

In response to discussions in
https://github.com/orgs/gem5/discussions/261, Squash Merges have been enabled.

This adds a GitHub Action to add a comment to a PR when the commit is in a mergable state explaining which strategy Merge or Squash Merge is preferable.

In response to discussions in
https://github.com/orgs/gem5/discussions/261, `Squash Merges` have been
enabled.

This adds a GitHub Action to add a comment to a PR when the commit is in
a mergable state explaining which strategy `Merge` or `Squash Merge` is
preferable.

Change-Id: I6537e351c02cd059e1ecd71f1d11ca6b08fa1f00
@BobbyRBruce BobbyRBruce added the github gem5 files necessary for GitHub integration. Found in ".github" label Oct 9, 2023
jobs:
write-single-commit-commment:
# Only run when the pull request is mergeable and has one commit
if: github.event.pull_request.mergeable == true && github.event.pull_request.comments == 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Do all single commit changes have a single comment? What happens if I comment on a PR, wouldn't that mean there would be >1 comment?

How about "commits"? See https://docs.github.com/en/webhooks/webhook-events-and-payloads#pull_request

issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'This PR is now in a mergeable state. As it as a multi-commit PR, we recommend using the `Merge`. Please ensure the title and description of the merge commit (defaulted to the PR title and description) is sufficient to describe the collection of patches. `Squash` may be used if you wish to squash all the commits into a single commit.'
Copy link
Contributor

Choose a reason for hiding this comment

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

You may want to add some information about when someone should squash vs merge.

@BobbyRBruce BobbyRBruce marked this pull request as draft October 16, 2023 16:46
@ivanaamit ivanaamit closed this Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
github gem5 files necessary for GitHub integration. Found in ".github"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants