Skip to content

fix(workflows): branch protection status checks fail when workflow uses on: paths filter#38237

Open
Exgene wants to merge 7 commits into
go-gitea:mainfrom
Exgene:fix/#36895-skip-status-filter
Open

fix(workflows): branch protection status checks fail when workflow uses on: paths filter#38237
Exgene wants to merge 7 commits into
go-gitea:mainfrom
Exgene:fix/#36895-skip-status-filter

Conversation

@Exgene

@Exgene Exgene commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Closes #36895

Problem

When a workflow's event matches (e.g. pull_request or push) but it is excluded by paths, paths-ignore, branches, or branches-ignore, no run was created. Because no run existed, no commit status was emitted, leaving required checks stuck at CommitStatusPending.

Solution

  • Create result enum for detectWorkflows named detectNotApplicable, detectFilteredOut and detectMatched to differentiate between filters and not applicable.
  • Create filtered job list from these enums.
  • Capture these filtered jobs in DetectWorkflows
  • Handle them and set things like isForkPullRequest etc and then insert the payload through PrepareRunAndInsert
  • Modify PrepareRunAndInsert to accommodate skipped workflows.

Testing

Performed manual testing and skipped status check is shown
image

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 27, 2026
@bircni

bircni commented Jun 30, 2026

Copy link
Copy Markdown
Member

could you fix the tests and conflicts?

@Exgene

Exgene commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

oh wonder why the tests are failing will report back

@Exgene

Exgene commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

could you fix the tests and conflicts?

Conflicts, should i create a merge commit? or any other workflow to be followed

@bircni

bircni commented Jun 30, 2026

Copy link
Copy Markdown
Member

could you fix the tests and conflicts?

Conflicts, should i create a merge commit? or any other workflow to be followed

yes please

Exgene added 2 commits June 30, 2026 22:10
…status-filter

# Conflicts:
#	services/actions/notifier_helper.go
#	services/actions/run.go
@Exgene

Exgene commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

@bircni made the changes, I have updated test cases accordingly as well so let me know if you want any behavioral changes

@bircni bircni added the backport/v1.27 This PR should be backported to Gitea 1.26 label Jun 30, 2026
@bircni bircni requested a review from Zettat123 June 30, 2026 16:55
@bircni

bircni commented Jun 30, 2026

Copy link
Copy Markdown
Member

will check

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jun 30, 2026
@Exgene

Exgene commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

right the grep did not find detectWorkflow, and maybe missed that change while merging

@Zettat123

Copy link
Copy Markdown
Contributor

Some logic related to scoped workflows needs to be adjusted. I will check it and make some updates.

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

Labels

backport/v1.27 This PR should be backported to Gitea 1.26 lgtm/need 1 This PR needs approval from one additional maintainer to be merged. type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants