first-contributions icon indicating copy to clipboard operation
first-contributions copied to clipboard

Implement Github Action auto-merge PR script with error handling and descriptive messages - (reference to #68620)

Open Esh07 opened this issue 1 year ago • 1 comments

Auto-Merge Contributors.md Changes in response to issue https://github.com/firstcontributions/first-contributions/issues/68620

This PR adds an automated process to merge pull requests that only modify the Contributors.md file. If changes are detected in this file, the PR will be automatically merged using the squash method. If changes are detected in other files, a comment will be posted indicating that the PR requires review.

Changes Made

How to Test

Note: The workflow will only run if the Contributors.md file is modified. If there are no changes to this file, the workflow will not be triggered and will be ignored.

Auto merge

  1. Create a new pull request that modifies the Contributors.md file only.
  2. Ensure that the pull request meets the criteria for automatic merging.
  3. Observe that the pull request is automatically merged using the squash merge method.
  4. Verify that the pull request was successfully merged.

Do not Auto merge (Hold for review)

  1. Create a new pull request that modifies additional files besides Contributors.md.
  2. Observe that the pull request is not automatically merged.
  3. Check the pull request comments for a message indicating that the PR requires review.

Types of Pull Requests and Messages

  • Type 1: Pull requests modifying only the Contributors.md file:
Success preview message Hello @Esh07, congratulations! You've successfully submitted a pull request. 🎉 Thanks for your contribution!

If you liked the tutorial, please star this repo by clicking the star button on the top right of this page.

Next steps

Continue contributing:

  • If you're looking for projects to contribute to, check out our web app webapp.
  • Join our Slack group: We have a community to help/support contributors. Slack Join slack group.
  • Share on social media: You can share this content to help more people. Twitter tweet. Facebook share
  • We'd love to hear your thoughts about this project. Let us know how we can improve by commenting or opening an issue here
  • Type 2: Pull requests modifying additional files besides Contributors.md:
    • Message: "Thank you for your pull request. This pull request contains changes in files that require review. The following files were changed:
      • [List of changed files] "

Please review and merge this PR if everything looks good.

Esh07 avatar Jun 14 '23 14:06 Esh07

@Roshanjossey The requested changes are now live and implemented. Cheers.

Esh07 avatar Jun 24 '23 18:06 Esh07

Thank you for adding this @Esh07. Great job.

Roshanjossey avatar Jul 11 '23 18:07 Roshanjossey