Difference between github and gitea actions when running contains(needs.*.result, 'success') #13006

Open
opened 2025-11-02 10:27:30 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @ldomesjo on GitHub (May 17, 2024).

Description

Hello,

I am trying to specify a job which is dependant on two other jobs finishing with an error, but there's seems to be a difference between how this is handled between github actions and gitea actions.
I created this example workflow for github, accessible here https://github.com/ldomesjo/testing-github-actions/tree/main/.github/workflows:

name: learn-github-actions
run-name: ${{ github.actor }} is learning GitHub Actions
on: [push]
jobs:
  first-job:
    runs-on: ubuntu-latest
    steps:
      - run: echo meh
  second-job:
    runs-on: ubuntu-latest
    steps:
      - run: echo meh
  third-job:
    runs-on: ubuntu-latest
    needs:
      - first-job
      - second-job
    steps:
      - run: echo '${{ toJSON(needs) }}'
      - run: echo ${{ contains(needs.*.result, 'success') }}

Which outputs this:
image

I then created a similar workflow for gitea actions looking like this:

name: learn-gitea-actions
run-name: ${{ gitea.actor }} is learning Gitea Actions
on: [push]
jobs:
  first-job:
    runs-on: action-runner
    steps:
      - run: echo meh
  second-job:
    runs-on: action-runner
    steps:
      - run: echo meh
  third-job:
    runs-on: action-runner
    needs:
      - first-job
      - second-job
    steps:
      - run: echo '${{ toJSON(needs) }}'
      - run: echo ${{ contains(needs.*.result, 'success') }}

Giving this output:
image

Gitea Version

1.21.11

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?

Running the rootless docker version of gitea

Database

None

Originally created by @ldomesjo on GitHub (May 17, 2024). ### Description Hello, I am trying to specify a job which is dependant on two other jobs finishing with an error, but there's seems to be a difference between how this is handled between github actions and gitea actions. I created this example workflow for github, accessible here https://github.com/ldomesjo/testing-github-actions/tree/main/.github/workflows: ```yaml name: learn-github-actions run-name: ${{ github.actor }} is learning GitHub Actions on: [push] jobs: first-job: runs-on: ubuntu-latest steps: - run: echo meh second-job: runs-on: ubuntu-latest steps: - run: echo meh third-job: runs-on: ubuntu-latest needs: - first-job - second-job steps: - run: echo '${{ toJSON(needs) }}' - run: echo ${{ contains(needs.*.result, 'success') }} ``` Which outputs this: ![image](https://github.com/go-gitea/gitea/assets/49636413/c0ccab03-ecba-48c5-82dc-7391383829d4) I then created a similar workflow for gitea actions looking like this: ```yaml name: learn-gitea-actions run-name: ${{ gitea.actor }} is learning Gitea Actions on: [push] jobs: first-job: runs-on: action-runner steps: - run: echo meh second-job: runs-on: action-runner steps: - run: echo meh third-job: runs-on: action-runner needs: - first-job - second-job steps: - run: echo '${{ toJSON(needs) }}' - run: echo ${{ contains(needs.*.result, 'success') }} ``` Giving this output: ![image](https://github.com/go-gitea/gitea/assets/49636413/642c00c6-d991-4cf2-93c7-9041ae903fe0) ### Gitea Version 1.21.11 ### 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? Running the rootless docker version of gitea ### Database None
GiteaMirror added the topic/gitea-actionstype/bugtype/upstream labels 2025-11-02 10:27:30 -06:00
Author
Owner

@yp05327 commented on GitHub (May 28, 2024):

image
related code in act

@yp05327 commented on GitHub (May 28, 2024): ![image](https://github.com/go-gitea/gitea/assets/18380374/50af21e3-7728-4e4c-b319-62b1b46e2c64) related code in act
Author
Owner

@ldomesjo commented on GitHub (Mar 13, 2025):

This has been fixed in upstream nektos/act, any chance of getting it merged into the gitea act mirror as well?

Related pull request: https://github.com/nektos/act/pull/2635

@ldomesjo commented on GitHub (Mar 13, 2025): This has been fixed in upstream `nektos/act`, any chance of getting it merged into the gitea act mirror as well? Related pull request: https://github.com/nektos/act/pull/2635
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13006