My goal is to fetch a list of files that were modified between 2 commits (or in 1 commit) using the
git diff-tree plumbing command, and I want to do this inside a GitHub Actions workflow on the ubuntu-latest runtime.
The problem is that the
git diff-tree stdout / stderr never appears on screen, and I can’t pipe it to a file. I tried running the command in a step run block, python script and inside a private Docker container action to no avail. Another post describes a solution, but this did not work for me. What’s interesting is that I can see the output of other git commands like
git --version or even
git help diff-tree but not the output of
git diff-tree ... itself.
My actions workflow configuration is basic:
- ubuntu-latest runtime
- push events only
- private repository
Is GitHub preventing me from using the
git diff-tree command? If so, where is this documented? Has anyone else encountered this issue?
Here is a snippet of the bash script I want to execute.
... tmpfile=$(mktemp) start=$(jq --raw-output .commits.id "$GITHUB_EVENT_PATH") end=$(jq --raw-output .commits[-1].id "$GITHUB_EVENT_PATH") if ["$start" = "$end"]; then git diff-tree --no-commit-id --name-only -r "$start" >"$tmpfile" else git diff-tree --no-commit-id --name-only -r "$start" "$end" >"$tmpfile" fi ...
Here is an example of what I see in the workflow console.