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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] implement an outputs for matrix compatible jobs #530
Comments
Thanks for reporting this issue, don't forget to star this project to help us reach a wider audience. |
Hi @onedr0p, based on the error
You seem to be passing a space-delimited string to the Possible Solution
See: https://docs.github.com/en/actions/learn-github-actions/expressions#example-returning-a-json-object |
@onedr0p Edited 猬嗭笍 |
@jackton1 Step: - name: Get changed notebooks
id: changed-notebooks
uses: tj-actions/changed-files@v23.1
with:
separator: "\", \""
files: |
**/*.ipynb Code: echo -e "Separator: \", \""
echo -e "Output: ${{ steps.changed-notebooks.outputs.all_changed_files }}"
echo -e "JSON format: {\"path\":[\"${{ steps.changed-notebooks.outputs.all_changed_files }}\""]}"
echo -e "::set-output name=changed_notebooks::{\"path\":[\"${{ steps.changed-notebooks.outputs.all_changed_files }}\""]}"
echo -e "JSON: ${{toJSON(needs.get-notebooks.outputs.changed_notebooks)}}" Result: Separator: ", "
Output: fail.ipynb, pass.ipynb
JSON format: {"path":["fail.ipynb, pass.ipynb"]}
echo -e ::set-output name=changed_notebooks::{"path":["fail.ipynb, pass.ipynb"]}
JSON: null Expected result: Separator: ", "
Output: fail.ipynb", "pass.ipynb
JSON format: {"path":["fail.ipynb", "pass.ipynb"]}
echo -e ::set-output name=changed_notebooks::{"path":["fail.ipynb", "pass.ipynb"]} |
Hi, I still have the error with the latest version:
I'm using the workflow file from the repository: https://github.com/tj-actions/changed-files/blob/dd1d85da10027d585a8e394aeee7524eb2f17bcf/.github/workflows/manual-matrix-test.yml Even if I change the matrix definition in the workflow file to the one from above (
|
@sebestenyb @guitmz Note the lack of space between the key and value a full example of this can be seen here: https://docs.github.com/en/actions/learn-github-actions/expressions#example-returning-a-json-object CHANGE matrix: "{\"container\": \"${{ steps.changed-files.outputs.all_changed_files }}\" }" TO matrix:"{\"container\":${{ steps.changed-files.outputs.all_changed_files }}}" See: https://github.com/tj-actions/changed-files/blob/main/.github/workflows/manual-matrix-test.yml#L27 |
Actually what fixed for me was to specify 24.1 in my GitHub actions instead of only 24 for the version. |
Cool. |
The latest test action in the repo is slightly different than the one in the PR merge commit above, it uses a separate step to set the matrix, like
Not sure this fixed, or the lack of spaces, but it works now, thanks for you help folks! |
Would any of you mind posting full working example with passing the json to matrix strategy in another job? |
Is this feature missing in the latest version?
Is your feature request related to a problem? Please describe.
Hi 馃憢馃徏
It would be need if you had an
outputs
that can work with a matrix, this does not workCheck out this workflow: https://github.com/onedr0p/containers/blob/c15d8b71b288f812edb971a4c3966e62592bba1c/.github/workflows/release.yaml
And the run: https://github.com/onedr0p/containers/runs/6996087930?check_suite_focus=true
And the error: https://github.com/onedr0p/containers/actions/runs/2539358559
Describe the solution you'd like?
Implement a
outputs.all_changed_files_json
or similar that can be used withtoJSON
andfromJSON
to pass the outputs on to a matrix.Thanks!
Describe alternatives you've considered?
No response
Anything else?
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: