Skip to content

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

Open
@ldomesjo

Description

@ldomesjo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic/gitea-actionsrelated to the actions of Giteatype/bugtype/upstreamThis is an issue in one of Gitea's dependencies and should be reported there

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions