Skip to content

fix(actions): don't show branch-filtered push workflows as skipped in pull requests#38365

Open
bircni wants to merge 1 commit into
go-gitea:mainfrom
bircni:fix-push-skipped
Open

fix(actions): don't show branch-filtered push workflows as skipped in pull requests#38365
bircni wants to merge 1 commit into
go-gitea:mainfrom
bircni:fix-push-skipped

Conversation

@bircni

@bircni bircni commented Jul 7, 2026

Copy link
Copy Markdown
Member

Closes #38351

Problem

A push-only workflow shows up as Skipped inside pull requests, where it should not appear at all.

Given two workflows:

# .gitea/workflows/push.yml
on:
  push:
    branches: [main]
# .gitea/workflows/pull.yml
on:
  pull_request:

Opening a PR from a feature branch surfaces the push workflow as a skipped check in the PR.

Cause

#38237 fixed required status checks getting stuck Pending when a workflow is excluded by a paths filter, by posting a CommitStatusSkipped status for filtered-out workflows. But matchPushEvent / matchPullRequestEvent returned detectFilteredOut for any filter mismatch — including a branch/tag mismatch.

So pushing to a feature branch, where the push workflow's branches: [main] filter excludes the ref, posted a skipped push status on that commit. Because the commit is the PR's head, the status leaked into the PR's checks.

@bircni bircni requested review from Zettat123 and wxiaoguang July 7, 2026 16:37
@GiteaBot GiteaBot added lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jul 7, 2026
@bircni bircni changed the title fixes fix(actions): don't show branch-filtered push workflows as skipped in pull requests Jul 7, 2026
@bircni bircni added the backport/v1.27 This PR should be backported to Gitea 1.27 label Jul 7, 2026
@bircni bircni mentioned this pull request Jul 7, 2026
22 tasks
@Zettat123

Copy link
Copy Markdown
Contributor

Now the behavior is:

  • path mismatch: create skipped commit status
  • ref mismatch: do not create commit status

Do we want to keep this behavior inconsistent? AFAIK, GitHub doesn't create a commit status for either type of mismatch.

wxiaoguang
wxiaoguang previously approved these changes Jul 8, 2026

@wxiaoguang wxiaoguang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rubberstamp approve since I haven't really looked into the details, while the code itself looks good.

@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 Jul 8, 2026
@wxiaoguang wxiaoguang dismissed their stale review July 8, 2026 00:51

wait for more feedbacks for #38365 (comment)

@GiteaBot GiteaBot added lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jul 8, 2026
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.27 lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Actions: Shows push workflow in pull request.

4 participants