-
Notifications
You must be signed in to change notification settings - Fork 5
only run core4 check on non-draft PRs #110
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR modifies the GitHub Actions workflow to only enforce the required label check on pull requests that target the default branch, avoiding unnecessary checks on PRs targeting other branches (e.g., feature branches).
Key Changes:
- Added a conditional check to the workflow job to filter PRs by their target branch
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.github/workflows/require-label.yaml
Outdated
|
|
||
| jobs: | ||
| require-label: | ||
| if: github.event.pull_request.base.ref == github.event.repository.default_branch |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comparison will always fail because github.event.repository.default_branch returns the branch name as a string (e.g., 'main'), but github.event.pull_request.base.ref also returns a string. However, the correct way to reference the default branch name is github.event.repository.default_branch without any further qualification. The condition should compare the base ref name directly: github.event.pull_request.base.ref == github.event.repository.default_branch.\n\nActually, upon closer inspection, this syntax is correct for the comparison. However, ensure this works as intended by testing, as the typical pattern seen is to use string literals or to be explicit about what's being compared.
| if: github.event.pull_request.base.ref == github.event.repository.default_branch | |
| if: github.ref_name == github.event.repository.default_branch |
after the outcome of discussions relating to guardian/support-service-lambdas#3280
on this thread https://chat.google.com/room/AAAAag0I08g/XFliRTXYAzQ/XFliRTXYAzQ?cls=10
This PR makes the workflow only run on PRs that are not draft
Tested using this PR guardian/support-service-lambdas#3280 :

and when it's marked ready for review

The only issue is you need to add "ready_for_review" as a trigger as seen in the above PR
https://github.com/guardian/support-service-lambdas/pull/3280/files#diff-121fb0d715d38abf3163eb63b4ce94e1a9e6fa685f89d8b61d9b8eb5e31cbb81R6