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

chore: auto close pr if opened from fork's main branch #27627

Merged
merged 5 commits into from
Oct 20, 2023

Conversation

vinayak-kukreja
Copy link
Contributor

This PR would enable closing a pull request automatically if it is opened from main branch of their fork.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Signed-off-by: Vinayak Kukreja <vinakuk@amazon.com>
@aws-cdk-automation aws-cdk-automation requested a review from a team October 20, 2023 15:25
@github-actions github-actions bot added the p2 label Oct 20, 2023
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Oct 20, 2023
Signed-off-by: Vinayak Kukreja <vinakuk@amazon.com>
// Closing the PR if it is opened from main branch of author's fork
if (failureMessages.includes(PR_FROM_MAIN_ERROR)) {

const errorMessageBody = 'We are unable to accept contributions from `main` branch of a fork. This pull request would be automatically closed now. Please open a new pull request from another branch on your fork. For more information, see https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md#step-4-pull-request.'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is in case there are multiple linter errors. This would clarify to the author why we are closing the PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Rico wants something more in line with https://github.com/aws/aws-cdk/pull/27625/files which is why he made that update. Can we just repeat the words there in the closing message?

Signed-off-by: Vinayak Kukreja <vinakuk@amazon.com>
@mergify
Copy link
Contributor

mergify bot commented Oct 20, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 5b65188
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 93904e8 into main Oct 20, 2023
11 checks passed
@mergify mergify bot deleted the vkukreja/close-pr-on-main branch October 20, 2023 17:20
@mergify
Copy link
Contributor

mergify bot commented Oct 20, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants