Actions not triggered on push events for mirrored repos #10913

Closed
opened 2025-11-02 09:21:59 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @dboreham on GitHub (May 25, 2023).

Description

This is a regression since around 1.19.2.

Previously Actions tasks would be run according to their event and branch rules on mirrored commits.
But in the current code (1.19.2,3 and in today's main branch) that doesn't happen. Tasks are never run.

Some debugging reveals that this is because the workflow filtering code in matchPushEvent() checks the supplied refName to see if it is a branch in this function. That check fails in the mirrored code path because refName lacks the necessary prefix. That is, it ends up being "main" not "refs/heads/main".

I tested a somewhat blind fix in that it works but I don't understand this part of the code well enough to know if it's the right fix.

Gitea Version

1.19.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

In docker-compose, using this setup: https://github.com/cerc-io/hosting/tree/main/gitea

Database

PostgreSQL

Originally created by @dboreham on GitHub (May 25, 2023). ### Description This is a regression since around 1.19.2. Previously Actions tasks would be run according to their event and branch rules on mirrored commits. But in the current code (1.19.2,3 and in today's main branch) that doesn't happen. Tasks are never run. Some debugging reveals that this is because the workflow filtering code in [matchPushEvent()](https://github.com/go-gitea/gitea/blob/main/modules/actions/workflows.go#L200) checks the supplied `refName` to see if it is a branch in [this function](https://github.com/go-gitea/gitea/blob/main/modules/git/ref.go#L70). That check fails in the mirrored code path because `refName` lacks the necessary prefix. That is, it ends up being "main" not "refs/heads/main". I tested a somewhat blind fix in that it works but I don't understand this part of the code well enough to know if it's the right fix. ### Gitea Version 1.19.3 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? In docker-compose, using this setup: https://github.com/cerc-io/hosting/tree/main/gitea ### Database PostgreSQL
GiteaMirror added the type/bug label 2025-11-02 09:22:00 -06:00
Author
Owner

@dboreham commented on GitHub (May 25, 2023):

Closing as a dup of https://github.com/go-gitea/gitea/issues/24824

@dboreham commented on GitHub (May 25, 2023): Closing as a dup of https://github.com/go-gitea/gitea/issues/24824
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10913