Hi, @samselikoff, I think it is because there is no local branch for the PR and to the command is exiting with a 1 (which continues the build) instead of the expected exit code of 0 (which
grep will use if there are any matching lines).
Here is what I see in testing:
$ git clone <repo url here>
Cloning into 'site'...
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4649 (delta 3), reused 2 (delta 2), pack-reused 4643
Receiving objects: 100% (4649/4649), 46.77 MiB | 10.58 MiB/s, done.
Resolving deltas: 100% (3077/3077), done.
$ cd site
$ git fetch origin pull/764/head
* branch refs/pull/764/head -> FETCH_HEAD
$ git log -1 --pretty=%B | grep dependabot ; echo $?
The exit code above is
1 which, again, will continue no cancel a build because there were no matching lines.
The following might work though:
$ git checkout -b pullrequest FETCH_HEAD ; git log -1 --pretty=%B | grep dependabot ; echo $?
fatal: A branch named 'pullrequest' already exists.
Signed-off-by: dependabot-preview[bot] <email@example.com>
So, (removing the exit code test
echo command), this would be:
git checkout -b pullrequest FETCH_HEAD ; git log -1 --pretty=%B | grep dependabot
Would you please test making that line above the
If that doesn’t work or if there are any questions, please let us know.