EndBug / add-and-commit

:octocat: Automatically commit changes made in your workflow run directly to your repo
MIT License
1.14k stars 117 forks source link

"add" with array input doesn't seem to work #533

Closed yaakov-h closed 1 year ago

yaakov-h commented 1 year ago

Describe the bug When using "add" with multiple inputs as a JSON or YAML array, it logs an error and does not add any files.

Workflow used YAML array (multiline list): https://github.com/pyconau/2023-website/commit/0f778f1f7d00d333026795316d9c2967eed0991d JSON array (single line): https://github.com/pyconau/2023-website/commit/d3f72484808941d5caa7dd16530215326e81881a

Expected behavior Multiple invocations of git add would be run to add multiple directories to the git staging area

Logs https://github.com/pyconau/2023-website/actions/runs/5878006660/job/15939224675

Error: Error: fatal: pathspec '-' did not match any files

https://github.com/pyconau/2023-website/actions/runs/5878046329/job/15939335610

Error: Error: fatal: pathspec '["public/people",' did not match any files

EndBug commented 1 year ago

Hi, I see that you're using an old version of the action: can you update to the latest one and try again? You can find all breaking changes in the release notes ;)

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

tommie commented 4 months ago

If anyone else ends up here because they are confused...

The add data is a multiline string interpreted as a YAML array, like OP tried. The problem is OP used a very old version (v5.3.0) while arrays has been supported since v6.