Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ldomesjo opened this issue May 17, 2024 · 1 comment
Labels
topic/gitea-actions related to the actions of Gitea type/bug type/upstream This is an issue in one of Gitea's dependencies and should be reported there

Comments

@ldomesjo
Copy link

ldomesjo commented 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

@Zettat123 Zettat123 added the topic/gitea-actions related to the actions of Gitea label May 17, 2024
@yp05327 yp05327 added the type/upstream This is an issue in one of Gitea's dependencies and should be reported there label May 28, 2024
@yp05327
Copy link
Contributor

yp05327 commented May 28, 2024

image
related code in act

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/gitea-actions related to the actions of Gitea type/bug type/upstream This is an issue in one of Gitea's dependencies and should be reported there
Projects
None yet
Development

No branches or pull requests

3 participants