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

correctly escaping multiple patterns when reading path from GITHUB_OUTPUT #394

Open
francesco-ballarin opened this issue Mar 18, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@francesco-ballarin
Copy link

What happened?

Hi,
what is the correct way to escape a new line when multiple patterns are read from the output of a previous step

I have tried two different options at
https://github.com/francesco-ballarin/test-artifacts-multiple/blob/main/.github/workflows/ci.yml

The first option is using \\n as separator. After #375, thanks to
https://github.com/actions/upload-artifact/blob/main/dist/index.js#L2280
I was expecting this to work, but I get

Warning: No files were found with the provided path: *.txt\n*.dat. No artifacts will be uploaded.

(notice that using \n would not work, as it would insert a new line in the echo ... >> ${GITHUB_OUTPUT} call)

The second option is using %0A as separator.
Before #375, I was quite sure that using %0A used to work (see e.g. https://trstringer.com/github-actions-multiline-strings/). After #375, I am quite confindent it will not work anymore, because
https://github.com/actions/upload-artifact/blob/main/dist/index.js#L2278
escapes the % in %0A. Due to this, I get

Warning: No files were found with the provided path: .txt%0A*.dat. No artifacts will be uploaded.

Can you comment on what is the correct way to use multiple patterns coming from GITHUB_OUTPUT in the v3 version of this action?

Thanks!

What did you expect to happen?

Being able to read multiple patterns from the output of a previous step

How can we reproduce it?

https://github.com/francesco-ballarin/test-artifacts-multiple/blob/main/.github/workflows/ci.yml

Anything else we need to know?

No response

What version of the action are you using?

v3

What are your runner environments?

linux

Are you on GitHub Enterprise Server? If so, what version?

No response

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

1 participant