Skip to content

enhance(actions): only create filtered-out workflow commit status for required contexts (#38371) - #38385

Merged
bircni merged 1 commit into
go-gitea:release/v1.27from
GiteaBot:backport-38371-v1.27
Jul 9, 2026
Merged

bircni merged 1 commit into
go-gitea:release/v1.27from
GiteaBot:backport-38371-v1.27

Conversation

@GiteaBot

@GiteaBot GiteaBot commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Backport #38371 by @Zettat123

Follow #38237

#38237 posts "skipped" commit statuses for every workflow that is not triggered due to a filter (e.g. paths or branches) mismatch. However, for non-required workflows, creating "skipped" commit statuses for them would generate a lot of noise.

To address this issue, this PR adds a check before creating commit status:

  • For the context that matches any required status check patterns, a "skipped" commit status will be created. The Required label can inform users that this status check is required, but has been skipped because of a filter mismatch.
image
  • For a non-required context, nothing will be created.

NOTE: Reducing noise is a best-effort approach and isn't entirely accurate. When creating commit statuses, it is impossible to predict which branch protection rule will take effect. Therefore, we have to compare the commit status context against the required patterns from all rules. If any rule matches, the context is considered "required".

Closes #38351

… required contexts (go-gitea#38371)

Follow go-gitea#38237

go-gitea#38237 posts "skipped" commit statuses for every workflow that is not
triggered due to a filter (e.g. `paths` or `branches`) mismatch.
However, for non-required workflows, creating "skipped" commit statuses
for them would generate a lot of noise.

To address this issue, this PR adds a check before creating commit
status:

- For the context that matches any required status check patterns, a
"skipped" commit status will be created. The `Required` label can inform
users that this status check is required, but has been skipped because
of a filter mismatch.
- For a non-required context, nothing will be created.

NOTE: Reducing noise is a best-effort approach and isn't entirely
accurate. When creating commit statuses, it is impossible to predict
which branch protection rule will take effect. Therefore, we have to
compare the commit status context against the required patterns from all
rules. If any rule matches, the context is considered "required".
@GiteaBot GiteaBot added topic/gitea-actions related to the actions of Gitea topic/ui Change the appearance of the Gitea UI type/enhancement An improvement of existing functionality lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jul 9, 2026
@GiteaBot GiteaBot added this to the 1.27.0 milestone Jul 9, 2026
@GiteaBot
GiteaBot requested review from bircni and lunny July 9, 2026 15:35
@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 9, 2026
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jul 9, 2026
@bircni
bircni enabled auto-merge (squash) July 9, 2026 15:48
@bircni
bircni merged commit 532828c into go-gitea:release/v1.27 Jul 9, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/gitea-actions related to the actions of Gitea topic/ui Change the appearance of the Gitea UI type/enhancement An improvement of existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants