Bug with job outputs when using matrix jobs #13809

Closed
opened 2025-11-02 10:53:48 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @akamoroz on GitHub (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

Originally created by @akamoroz on GitHub (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
GiteaMirror added the topic/gitea-actionstype/bug labels 2025-11-02 10:53:48 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13809