Github actions, gradle. pretty=format flag for git log is not working

I have a weird problem using Github’s actions. I have a Gradle task that prints release notes to file (it works perfectly fine locally). But using GitHub actions it seems like I cannot use –pretty=format: flag for git log. For an unknown reason, it doesn’t print anything. It works when I remove this flag or when I set it to something without quotation marks. Maybe it’s a problem with escaping those characters? Nevertheless, it’s super weird.

And no it’s not a problem fetch-depth, it is set to 0, history is correct.
When I run it like that:

        run: |-
          git log develop --no-merges --date=short --pretty=format:"%ad %an: %s" v1.0.0...HEAD

it works as well. It only doesn’t work with the Gradle task inside Github action.

Example run:,

There are plenty of it because I was trying everything to check where the problem is.

To be even more precise. This command inside the Gradle task does work:

 printf("git log develop --no-merges --date=short --pretty=oneline ${tag}...HEAD".execute().text.trim())

and it doesn’t:

 printf("git log develop --no-merges --date=short --pretty=\"%ad %an: %s\" ${getNewestTag()}...HEAD".execute().text.trim())

After changing my runner from Linux to windows it started to work (locally I use windows).

I assume that Linux runnable works differently with escape characters. It probably ends up with error when I put " or % signs inside a command.