-
Notifications
You must be signed in to change notification settings - Fork 10
Add required CI job for branch protection #165
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
Co-authored-by: TheDeepestSpace <11333378+TheDeepestSpace@users.noreply.github.com>
Co-authored-by: TheDeepestSpace <11333378+TheDeepestSpace@users.noreply.github.com>
|
|
||
| # This job ensures all CI checks pass before allowing PR merges | ||
| # Mark this job as required in branch protection settings | ||
| required: |
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.
i thought that there was some sort a flag i can attach to a job that will mark it as required and not let me merge a PR if its not passing; i remember that such jobs has a "required" tag on them
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.
@copilot ^
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.
You're right that jobs marked as required in branch protection settings show a "Required" badge in the PR checks UI. However, there's no workflow-level attribute (like required: true) that automatically makes a job required - you still need to configure it in Settings → Branches → Branch protection rules.
The required job I added provides a single, stable status check name that you can mark as required in branch protection. This is the standard pattern because:
- Individual job names can change when workflows are modified
- A single gating job is easier to manage than multiple required checks
- It ensures all critical jobs pass with one configuration
To enable it: Go to Settings → Branches → Add/edit rule for main → Check "Require status checks to pass" → Select the required check.
Prevent merging broken PRs by providing a single status check that gates on all critical CI jobs.
Changes
Added
requiredjob to.github/workflows/ci.yaml:svlint,build_and_test,riscof, andde1-socif: always()to run regardless of dependency outcomesCreated
.github/REQUIRED_CHECKS.md: Documents branch protection configurationUsage
Configure branch protection to require the
requiredstatus check. This provides a stable check name instead of tracking individual job names.Repository admins: mark the
requiredcheck as mandatory in Settings → Branches → Branch protection rules.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.