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: Prevent PR merge with do not merge labels #484

Merged
merged 1 commit into from
Sep 10, 2023
Merged

Conversation

kdheepak
Copy link
Collaborator

@kdheepak kdheepak commented Sep 10, 2023

This PR prevents merges if a do not merge label is added on GitHub.

This PR also fixes an issue that allows checking PR titles with backticks in the title string.

@codecov
Copy link

codecov bot commented Sep 10, 2023

Codecov Report

Merging #484 (763a83f) into main (983ea7f) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #484   +/-   ##
=======================================
  Coverage   90.16%   90.16%           
=======================================
  Files          41       41           
  Lines       11277    11277           
=======================================
  Hits        10168    10168           
  Misses       1109     1109           

@kdheepak
Copy link
Collaborator Author

With the current title of this PR, the check-breaking-change-label step will fail; but this PR will fix it and going forward this won't be an issue. So this PR can be merged even if that step fails.

@kdheepak kdheepak merged commit 322e46f into main Sep 10, 2023
35 of 37 checks passed
@kdheepak kdheepak deleted the do-not-merge-action branch September 10, 2023 08:16
pattern='^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?!:'
if echo "$title" | grep -qE "$pattern"; then
# Check if pattern matches
if echo "${{ github.event.pull_request.title }}" | grep -qE "$pattern"; then
Copy link
Member

Choose a reason for hiding this comment

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

We could probably do something like this here:

if [[ "${{ github.event.pull_request.title }}" =~ $pattern ]]; then

But I'm too late for the review, can you guys wait a bit before merge?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sorry about that! Next time I'll wait longer for merges.

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.

3 participants