Skip to content

Branch protection status checks fail when workflow uses on: paths filter #36895

Description

@douglarek

Description

Description

When branch protection is enabled with required status checks, and a workflow uses on: paths filter, if the PR doesn't match the specified paths, the workflow won't be triggered. This causes the PR status check to always
show "Some required checks are missing" because the required check will never run.

Image Image

Steps to Reproduce

  1. Enable branch protection on a branch (e.g., main)
  2. Configure the branch protection to require status checks
  3. Add a status check requirement (e.g., ci/workflow-name)
  4. Create/modify a GitHub Actions workflow with on: paths filter:
    on:                                                                                                                                                                                                                           
      pull_request:                                                                                                                                                                                                               
        paths:                                                                                                                                                                                                                    
          - "src/**"                                                                                                                                                                                                                                                                                                                                                                                                                                         
                                                                                                                                                                                                                                  
  5. Create a PR that modifies files outside the specified paths (e.g., only documentation files)
  6. Check the PR status checks

Expected Behavior

  • The workflow should either:
    • Option A: Still run and report a "skipped" or "success" status when paths don't match
    • Option B: Gitea should recognize that the workflow was intentionally skipped due to paths filter and not require it
    • Option C: Provide a configuration option to mark certain checks as "optional when skipped"

Actual Behavior

  • The workflow is not triggered at all
  • The required status check is missing
  • PR cannot be merged because "Some required checks are missing"
  • User is forced to either:
    • Remove the paths filter (causing unnecessary CI runs)
    • Disable branch protection status check requirement
    • Manually trigger the workflow

Gitea Version

1.25.5

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

using docker rootless image

Database

None

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions