Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Action fails when `add` or `remove` only contain a space

See original GitHub issue

I suppose what I could do here is simply have 2 steps with conditionals, but that would end up with 2 commits which seems less elegant. Might be nice if it checked for empty and then did nothing on empty (except maybe log a warning).

    - uses: EndBug/add-and-commit@v7
        message: Generate SVG images for PlantUML diagrams
        add: ${{ steps.puml-diff.outputs.changed-light }} ${{ steps.puml-diff.outputs.changed-dark }}
        remove: ${{ steps.puml-files.outputs.removed-light }} ${{ steps.puml-files.outputs.removed-dark }}
Run EndBug/add-and-commit@v7
    message: Generate SVG images for PlantUML diagrams
    add:  docs/domain-model/.svg/user-light.svg  docs/domain-model/.svg/user-dark.svg
    author_name: xenoterracide
    cwd: .
    pull_strategy: --no-rebase
    push: true
Running in /home/runner/work/iw-ppm-backend/iw-ppm-backend
Add input parsed as single string, running 1 git add command.
> Using 'xenoterracide <>' as author.
> Using "Generate SVG images for PlantUML diagrams" as commit message.
Internal logs
  > Staging files...
  > Adding files...
  Error: Error: fatal: empty string is not a valid pathspec. please use . instead if you meant to match all paths

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

xenoterracidecommented, Apr 3, 2021

Oh, I got it tested last night finally. It seems to work now

On Sat, Apr 3, 2021, 9:00 AM Federico Grandi @.***> wrote:

The action will not stop if git commands fail because they don’t match any file, this is intended behavior. If you want the workflow run to fail in this situation you’ll have to either run a custom command or use an action like [this].(

Please test @.*** as soon as you can, thank you.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe .

EndBugcommented, Mar 30, 2021

Hi, thanks for the report! You’re right, you could do separate steps with checks, but it’s really counter-intuitive that an empty string causes the action to fail, also because the default value for remove is actually an empty string. The problem comes from the fact that that string technically isn’t empty, but it contains a space character ' '. I’ll solve this by trimming the add and remove strings, so that strings like that will become empty.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Removing white space after using the Replace() expression
Firstly - The 'Filter array' action checks the individual words in the name.If a word is blacklisted it is removed. Secondly - The...
Read more >
Not allow a blank character / space in a input form [duplicate]
I'd recommend blocking the submission of the form, rather than preventing default action of the space key, which could be inadvertently circumvented by ......
Read more >
action: doremovespace failing ... any ideas?
The messages here are essentially saying that something caused your space deletion to fail, and the task is rolling back. There should be...
Read more >
How to handle the space in secret value in github settings
I am getting the below error, by using secret token above format. Getting the issue with space between secret value “Token xxxxxxxxxxx”.
Read more >
URL from string with spaces in it | Apple Developer Forums
You should escape the spaces. To do that, you can either change the spaces to "%20" or "+". Posted 7 years ago ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found