Skip to content

chore: add required-checks gate workflow and CODEOWNERS - #1967

Merged
mschile merged 1 commit into
masterfrom
mschile/github-actions-branch-protection-1c8ebc
Nov 12, 2026
Merged

mschile merged 1 commit into
masterfrom
mschile/github-actions-branch-protection-1c8ebc

Conversation

@mschile

@mschile mschile commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A PR here runs ~95 checks (about 90 Actions jobs across ~30 workflow files, plus CLA, Snyk, Renovate and Cursor Bugbot). This adds a single gate check so branch protection can require one Actions check instead of listing every job.

  • .github/workflows/required-checks.yml: an all-green job that polls the workflow runs for the PR head commit (event: pull_request, excluding its own workflow) every 30s. It fails as soon as any run completes with a conclusion other than success, neutral or skipped, and passes once all runs have completed. It works at the workflow-run level, so matrix legs, needs chains and skipped jobs (e.g. release) are handled by each run's own conclusion. It uses only actions/github-script@v9 with actions: read, and a new push to the PR cancels the previous gate run.
  • .github/CODEOWNERS: assigns /.github/ to @cypress-io/app. pull_request workflows run from the PR's own copy of .github/workflows/ (including fork PRs, after approval), so a PR could otherwise edit or shadow the gate.

After merge (repo settings)

  • Require these status checks on master: all-green (expected source: GitHub Actions), license/cla, security/snyk (Cypress Tools), license/snyk (Cypress Tools). The commit statuses are required directly so the gate doesn't race their late arrival.
  • Enable "Require review from Code Owners" for CODEOWNERS to take effect. Note that Renovate automerges PRs that bump actions/images in .github/workflows/, and those would then wait for an @cypress-io/app approval.

Notes for reviewers

  • If a failed workflow is re-run and passes, all-green also needs a re-run; it reads each run's latest attempt.
  • The gate script was exercised locally against real API data: it passed on chore(deps): update dependency cypress to v16.3.0 #1966's head commit (29 workflows) and failed on a commit with a failed check-markdown run. The waiting path is first exercised live on this PR.

🤖 Generated with Claude Code


Note

Low Risk
Changes are limited to GitHub Actions and ownership rules; no runtime application code, with only CI gating behavior at stake if the polling logic is wrong.

Overview
Adds a single branch-protection status check so repos no longer need to list dozens of individual Actions jobs on every PR.

The new required-checks workflow runs an all-green job that polls all other pull_request workflow runs for the PR head SHA every 30s, treats only the latest run per workflow, and fails fast on any non-passing conclusion (success, neutral, skipped count as pass). Concurrency cancels in-flight gate runs when the PR updates.

CODEOWNERS assigns /.github/ to @cypress-io/app so PRs cannot change or replace the gate workflow without owner review (PRs execute workflow files from the PR branch, including forks after approval).

After merge, branch protection should require all-green plus external checks (CLA, Snyk) directly, and enable require review from code owners.

Reviewed by Cursor Bugbot for commit 841d3c5. Bugbot is set up for automated code reviews on this repo. Configure here.

Adds a single all-green check that waits for every other pull_request
workflow run on the PR head commit and fails if any of them fails, so
branch protection can require one check instead of ~90 job names.

Assigns /.github/ to @cypress-io/app so workflow changes, including
edits to the gate itself, can require code owner review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mschile mschile self-assigned this Nov 11, 2026
@MikeMcC399

Copy link
Copy Markdown
Collaborator

What happens if https://github.com/cypress-io/github-action/actions/workflows/check-markdown.yml fails?

This shouldn't stop a PR from merging because it can be caused by temporary external influences (like today when Ubuntu had a 7.5 hour major outage).

@mschile

mschile commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator Author

The way this workflow is currently written, it would block the PR. We can still override that and merge the PR if need be though. Has this been a reoccurring problem?

@MikeMcC399

Copy link
Copy Markdown
Collaborator

markdown link checks are a continual issue. It's the reason that it's a separate workflow.

You can leave it the way you've planned, and see how often you need to get involved manually.

Some failures are transient, others involve stale links that do need correction anyway.

@mschile

mschile commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for the info! Yeah, I think leaving it as-is for now and see if an ignore list is needed in the future will be best.

@mschile
mschile merged commit ad71a03 into master Nov 12, 2026
97 checks passed
@mschile
mschile deleted the mschile/github-actions-branch-protection-1c8ebc branch November 12, 2026 01:17
@MikeMcC399

Copy link
Copy Markdown
Collaborator

Failures can be listed with https://github.com/cypress-io/github-action/actions/workflows/check-markdown.yml?query=is%3Afailure

You'll see how it goes in future.

@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 7.4.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants