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

[BUG] Cannot unmarshal matrix param #2104

Closed
4 tasks done
arminzaugg opened this issue May 22, 2024 · 2 comments
Closed
4 tasks done

[BUG] Cannot unmarshal matrix param #2104

arminzaugg opened this issue May 22, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@arminzaugg
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Does this issue exist in the latest version?

  • I'm using the latest release

Describe the bug?

I encounter an issue when using the parameter matrix.
In my example the output yields in [demo,homepage]

When using the matrix in the next job I encounter the errror ERRO[0006] Error while evaluating matrix: Invalid JSON: unexpected end of JSON input FATA[0006] Failed to decode node {4 0 !!map <nil> [0x1400041ec80 0x1400041ed20] 45 9} into *map[string][]interface {}: yaml: unmarshal errors: line 45: cannot unmarshal !!str ${{ fro...into []interface {}

However when I hard code the expected matrix value the action works fine.
`
- name: Changed Directories
id: changed_dirs
uses: tj-actions/[email protected]
with:
dir_names: true
matrix: true
path: 'compose-stacks'

  - name: List all changed Directories
    id: get_changed_dirs
    run: |
      echo "${{ steps.changed_dirs.outputs.all_changed_files }}"

deploy:
needs: [changed-dirs]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dir: ${{ fromJson(needs.changed-dirs.outputs.matrix) }}
#dir: [demo,homepage]
`

To Reproduce

This might be tricky as I am using a private repo. The relevant parts of the workflow file is copied/pasted above.

What OS are you seeing the problem on?

ubuntu-latest or ubuntu-22.04

Expected behavior?

The output should be used as matrix value in the next job.

Relevant log output

##[debug]Evaluating condition for step: 'Post Checkout repository'
##[debug]Evaluating: always()
##[debug]Evaluating always:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Post Checkout repository
##[debug]Loading inputs
##[debug]Evaluating: github.repository
##[debug]Evaluating Index:
##[debug]..Evaluating github:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'repository'
##[debug]=> 'arminzaugg/monorepo'
##[debug]Result: 'arminzaugg/monorepo'
##[debug]Evaluating: github.token
##[debug]Evaluating Index:
##[debug]..Evaluating github:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'token'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Loading env
Post job cleanup.
##[debug]Getting git version
/usr/bin/git version
git version 2.45.1
##[debug]0
##[debug]git version 2.45.1
##[debug]
##[debug]Set git useragent to: git/2.45.1 (github-actions-checkout)
::add-mask::***
Copying '/home/runner/.gitconfig' to '/home/runner/work/_temp/e6315fbe-ad0e-490d-8896-79c5bb6514d8/.gitconfig'
Temporarily overriding HOME='/home/runner/work/_temp/e6315fbe-ad0e-490d-8896-79c5bb6514d8' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
/usr/bin/git config --global --add safe.directory /home/runner/work/monorepo/monorepo
##[debug]0
##[debug]
/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
##[debug]1
##[debug]
/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
##[debug]0
##[debug]
/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
http.https://github.com/.extraheader
##[debug]0
##[debug]http.https://github.com/.extraheader
##[debug]
/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
##[debug]0
##[debug]
/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
##[debug]0
##[debug]
##[debug]Unsetting HOME override
##[debug]Node Action run completed with exit code 0
##[debug]Finishing: Post Checkout repository
0s
##[debug]Starting: Complete job
Evaluate and set job outputs
##[debug]Evaluating: steps.get_changed_dirs.outputs.all_changed_files
##[debug]Evaluating Index:
##[debug]..Evaluating Index:
##[debug]....Evaluating Index:
##[debug]......Evaluating steps:
##[debug]......=> Object
##[debug]......Evaluating String:
##[debug]......=> 'get_changed_dirs'
##[debug]....=> Object
##[debug]....Evaluating String:
##[debug]....=> 'outputs'
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'all_changed_files'
##[debug]=> null
##[debug]Result: null
##[debug]Skip output 'matrix' since it's empty
Uploading runner diagnostic logs
##[debug]Starting diagnostic file upload.
##[debug]Setting up diagnostic log folders.
##[debug]Creating diagnostic log files folder.
##[debug]Copying 1 worker diagnostic logs.
##[debug]Copying 1 runner diagnostic logs.
##[debug]Zipping diagnostic files.
##[debug]Uploading diagnostic metadata file.
##[debug]Diagnostic file upload complete.
Completed runner diagnostic log upload
Cleaning up orphan processes
##[debug]Finishing: Complete job

Has all relevant logs been included?

  • I've included all relevant logs

Anything else?

This is maybe just me missing something rather than a bug. Any input is highly appreciated.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@arminzaugg arminzaugg added the bug Something isn't working label May 22, 2024
@tj-actions-bot
Copy link
Contributor

Thanks for reporting this issue, don't forget to star this project if you haven't already to help us reach a wider audience.

@arminzaugg
Copy link
Author

typo found, issue closed, happy times 🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants