Inconsistent outcome with conditional jobs in reusable workflow #13682

Closed
opened 2025-11-02 10:50:12 -06:00 by GiteaMirror · 10 comments
Owner

Originally created by @2franix on GitHub (Nov 6, 2024).

Description

Repro case here: https://code2.defx.fr/cyrille/shell-bug-repro

This repo contains two workflows: one calling the other. The reusable workflows contains two jobs, the first being conditional, controlled by a cond input. The caller sets the input to false so the first job in the reusable workflow should always be skipped.

When running the caller workflow, I expect it to complete successfully by skipping the first reusable job and completing the second. This is what I get on one machine (see the screenshot with the light theme). But on another machine, I get what's shown on the screenshot with the dark theme: the workflow fails.

On the two machines, I am running the exact same docker compose project, with the exact same images that I pulled today. I consistently get the same result.

I have tried to dig into the code but after a few hours of research, I could not come to any conclusion.

I added a gist to the logs on the machine that fails to run the workflow as expected.

Gitea Version

1.22.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/2franix/6d130a03c51ec33cc09ad33cb00e6cf5

Screenshots

On the machine failing to run the workflow:
image

On the machine succeeding:
image

Git Version

1.22.3

Operating System

Debian Bookworm 12.7

How are you running Gitea?

I am running Gitea on Docker with the following images:

  • Gitea: gitea/gitea:latest-rootless
  • ACT Runner: gitea/act_runner:latest
  • The runner is configured with GITEA_RUNNER_LABELS: "ubuntu-latest:docker:ghcr.io/catthehacker/ubuntu:act-latest"

Database

MySQL/MariaDB

Originally created by @2franix on GitHub (Nov 6, 2024). ### Description Repro case here: https://code2.defx.fr/cyrille/shell-bug-repro This repo contains two workflows: one calling the other. The reusable workflows contains two jobs, the first being conditional, controlled by a `cond` input. The caller sets the input to `false` so the first job in the reusable workflow should always be skipped. When running the caller workflow, I expect it to complete successfully by skipping the first reusable job and completing the second. This is what I get on one machine (see the screenshot with the light theme). But on another machine, I get what's shown on the screenshot with the dark theme: the workflow fails. On the two machines, I am running the exact same docker compose project, with the exact same images that I pulled today. I consistently get the same result. I have tried to dig into the code but after a few hours of research, I could not come to any conclusion. I added a gist to the logs on the machine that fails to run the workflow as expected. ### Gitea Version 1.22.3 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist https://gist.github.com/2franix/6d130a03c51ec33cc09ad33cb00e6cf5 ### Screenshots On the machine failing to run the workflow: ![image](https://github.com/user-attachments/assets/c9c8ba6b-5589-474a-acc1-3b0bfe3e6a4f) On the machine succeeding: ![image](https://github.com/user-attachments/assets/defd33a3-45cb-4b02-8e18-6fc46071dad6) ### Git Version 1.22.3 ### Operating System Debian Bookworm 12.7 ### How are you running Gitea? I am running Gitea on Docker with the following images: - Gitea: gitea/gitea:latest-rootless - ACT Runner: gitea/act_runner:latest - The runner is configured with `GITEA_RUNNER_LABELS: "ubuntu-latest:docker:ghcr.io/catthehacker/ubuntu:act-latest"` ### Database MySQL/MariaDB
GiteaMirror added the topic/gitea-actionstype/bug labels 2025-11-02 10:50:12 -06:00
Author
Owner

@2franix commented on GitHub (Nov 6, 2024):

Don't mind the name of the repo shell-bug-repro: I initially thought it was because my input was named shell instead of cond. But I later renamed it and the issue persisted.

If anyone has a clue or any ideas as to how I could debug this further, I'd love to hear from them. Thanks!

@2franix commented on GitHub (Nov 6, 2024): Don't mind the name of the repo `shell-bug-repro`: I initially thought it was because my input was named `shell` instead of `cond`. But I later renamed it and the issue persisted. If anyone has a clue or any ideas as to how I could debug this further, I'd love to hear from them. Thanks!
Author
Owner

@2franix commented on GitHub (Nov 6, 2024):

FWIW, I also reproduced the bug after removing the cond input and setting the condition to if: false in the reusable workflow.

I also tried to reverse the order of jobs in the reusable workflow and it led to the same outcome.

@2franix commented on GitHub (Nov 6, 2024): FWIW, I also reproduced the bug after removing the `cond` input and setting the condition to `if: false` in the reusable workflow. I also tried to reverse the order of jobs in the reusable workflow and it led to the same outcome.
Author
Owner

@2franix commented on GitHub (Nov 6, 2024):

When changing the condition to if: true or when moving the condition to the single step, then the workflow runs successfully as expected.

@2franix commented on GitHub (Nov 6, 2024): When changing the condition to `if: true` or when moving the condition to the single step, then the workflow runs successfully as expected.
Author
Owner

@Zettat123 commented on GitHub (Nov 8, 2024):

I think this might be a bug on the act_runner side. I'll take a look

@Zettat123 commented on GitHub (Nov 8, 2024): I think this might be a bug on the act_runner side. I'll take a look
Author
Owner

@2franix commented on GitHub (Nov 8, 2024):

Thanks! Let me know if there is anything I can help with. It looks like this is a bug that may be difficult to reproduce.

@2franix commented on GitHub (Nov 8, 2024): Thanks! Let me know if there is anything I can help with. It looks like this is a bug that may be difficult to reproduce.
Author
Owner

@Zettat123 commented on GitHub (Nov 10, 2024):

I reproduced the issue. But I don't know why one of your machines can run the job successfully. Are the configurations of the two act_runners different?

@Zettat123 commented on GitHub (Nov 10, 2024): I reproduced the issue. But I don't know why one of your machines can run the job successfully. Are the configurations of the two act_runners different?
Author
Owner

@2franix commented on GitHub (Nov 10, 2024):

First and foremost: thank you for looking into it.

No, all my config is identical on the two machines, except two env vars: GITEA__ui__DEFAULT_THEME setting the theme, and GITEA____APP_NAME setting the name. The remainder is configured via compose or via the runner config in git.

Anyway, that's good news if you managed to reproduce!

Maybe if you explain what you have found, I can figure out why one of my machines does not exhibit the issue?

@2franix commented on GitHub (Nov 10, 2024): First and foremost: thank you for looking into it. No, all my config is identical on the two machines, except two env vars: `GITEA__ui__DEFAULT_THEME` setting the theme, and `GITEA____APP_NAME` setting the name. The remainder is configured via compose or via the runner config in git. Anyway, that's good news if you managed to reproduce! Maybe if you explain what you have found, I can figure out why one of my machines does not exhibit the issue?
Author
Owner

@Zettat123 commented on GitHub (Nov 12, 2024):

I created a PR to fix this issue https://gitea.com/gitea/act/pulls/122

@Zettat123 commented on GitHub (Nov 12, 2024): I created a PR to fix this issue https://gitea.com/gitea/act/pulls/122
Author
Owner

@kemzeb commented on GitHub (Dec 2, 2024):

With the related PR merged, can this issue be closed?

@kemzeb commented on GitHub (Dec 2, 2024): With the related PR merged, can this issue be closed?
Author
Owner

@2franix commented on GitHub (Dec 4, 2024):

Sure. We can always reopen it later if the bug is still there. Thanks for fixing, @Zettat123!

@2franix commented on GitHub (Dec 4, 2024): Sure. We can always reopen it later if the bug is still there. Thanks for fixing, @Zettat123!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13682