Skip to content

Bug with job outputs when using matrix jobs #32795

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

Closed
akamoroz opened this issue Dec 11, 2024 · 0 comments · Fixed by #32823
Closed

Bug with job outputs when using matrix jobs #32795

akamoroz opened this issue Dec 11, 2024 · 0 comments · Fixed by #32823
Labels
topic/gitea-actions related to the actions of Gitea type/bug

Comments

@akamoroz
Copy link

akamoroz commented Dec 11, 2024

Description

Hello, I found a bug which affected outputs when using matrix jobs.

Here an example of jobs: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#using-job-outputs-in-a-matrix-job

jobs:
  job1:
    runs-on: ubuntu-latest
    outputs:
      output_1: ${{ steps.gen_output.outputs.output_1 }}
      output_2: ${{ steps.gen_output.outputs.output_2 }}
      output_3: ${{ steps.gen_output.outputs.output_3 }}
    strategy:
      matrix:
        version: [1, 2, 3]
    steps:
      - name: Generate output
        id: gen_output
        run: |
          version="${{ matrix.version }}"
          echo "output_${version}=${version}" >> "$GITHUB_OUTPUT"
  job2:
    runs-on: ubuntu-latest
    needs: [job1]
    steps:
      # Will show
      # {
      #   "output_1": "1",
      #   "output_2": "2",
      #   "output_3": "3"
      # }
      - run: echo '${{ toJSON(needs.job1.outputs) }}'

However it shows in Gitea:

{
  "output_1": "1",
  "output_2": "",
  "output_3": ""
}

I think the issue in evaluating outputs for every matrix job:

🏁  Job succeeded
expression '${{ steps.gen_output.outputs.output_1 }}' rewritten to 'format('{0}', steps.gen_output.outputs.output_1)'
evaluating expression 'format('{0}', steps.gen_output.outputs.output_1)'
expression 'format('{0}', steps.gen_output.outputs.output_1)' evaluated to '%!t(string=)'
expression '${{ steps.gen_output.outputs.output_2 }}' rewritten to 'format('{0}', steps.gen_output.outputs.output_2)'
evaluating expression 'format('{0}', steps.gen_output.outputs.output_2)'
expression 'format('{0}', steps.gen_output.outputs.output_2)' evaluated to '%!t(string=)'
expression '${{ steps.gen_output.outputs.output_3 }}' rewritten to 'format('{0}', steps.gen_output.outputs.output_3)'
evaluating expression 'format('{0}', steps.gen_output.outputs.output_3)'
expression 'format('{0}', steps.gen_output.outputs.output_3)' evaluated to '%!t(string=3)'

Could you please fix it and provide a workaround for now?

Thanks!

Gitea Version

v1.22.4

@kemzeb kemzeb added the topic/gitea-actions related to the actions of Gitea label Dec 11, 2024
@lunny lunny closed this as completed in 7269130 Dec 14, 2024
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Mar 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/gitea-actions related to the actions of Gitea type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants