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 workflow to prevent merging a PR when the NO-MERGE label is applied #111940

Merged
merged 3 commits into from
Jan 29, 2025

Conversation

carlossanlop
Copy link
Member

@carlossanlop carlossanlop commented Jan 29, 2025

Fixes #105452

We should backport to the servicing branches as well.

@carlossanlop carlossanlop requested a review from a team January 29, 2025 02:00
@carlossanlop carlossanlop self-assigned this Jan 29, 2025
steps:
- name: Check 'NO-MERGE' label
run: |
echo "Merging permission is disabled when the `NO-MERGE` label is applied."
Copy link
Member Author

Choose a reason for hiding this comment

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

Ok this is backwards. When the label is applied, we need to go to the error. When it is not applied, we exit 0.

Will fix tomorrow.

Copy link
Member

Choose a reason for hiding this comment

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

note that the backticks in the echo string mean that bash will try to run that as a command. this is a bug in the servicing-labels action too

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh wow, didn't know that. Thanks for noticing.

Copy link
Member Author

Choose a reason for hiding this comment

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

That means we have a bug here! I'll include the fix in this PR:

echo "Merging permission is enabled for servicing PRs when the `Servicing-approved` label is applied."

cc @hoyosjs fyi

@carlossanlop carlossanlop marked this pull request as draft January 29, 2025 06:35
@carlossanlop carlossanlop marked this pull request as ready for review January 29, 2025 16:59
@carlossanlop carlossanlop added the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Jan 29, 2025
@carlossanlop
Copy link
Member Author

carlossanlop commented Jan 29, 2025

It's working!

Applied:
image

Removed:
image

@carlossanlop carlossanlop added Servicing-approved Approved for servicing release and removed NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) Servicing-approved Approved for servicing release labels Jan 29, 2025
@carlossanlop carlossanlop merged commit 87e9f1d into dotnet:main Jan 29, 2025
19 of 20 checks passed
@carlossanlop carlossanlop deleted the NoMergeWorkflow branch January 29, 2025 17:09
@carlossanlop
Copy link
Member Author

/backport to release/9.0-staging

@carlossanlop
Copy link
Member Author

/backport to release/8.0-staging

Copy link
Contributor

Started backporting to release/9.0-staging: https://github.com/dotnet/runtime/actions/runs/13036681388

Copy link
Contributor

Started backporting to release/8.0-staging: https://github.com/dotnet/runtime/actions/runs/13036684248

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add a required check for the NO-MERGE label
3 participants