Unable to use trufflehog actions on pull_request

I am working on implementing secrets scanning for a repository . I am trying to use the Trufflehog action available in the Marketplace

I incorporated the usage example provided on the above page in my Github Workflow file.

name: Trufflehog Secrets Scan

    - [ <branch_name> ]

    runs-on: ubuntu-latest
      - uses: actions/checkout@v2.3.2

      - uses: UnicornGlobal/trufflehog-actions-scan@master
         branch: ${{ github.ref }}

The action or scan works fine on the “push” event, and is able to find secrets in the code. However my goal is to trigger this scan when a PR is opened from 1 of the branches , to the “main” branch of the repo. However the Trufflehog step ends in an error . Here is what I am seeing

For “pull” event

In the checkout step

Checking out the ref
  /usr/bin/git checkout --progress --force -B secrets4 refs/remotes/origin/<branchname>  
Switched to a new branch '<branchname>'
  Branch '<branchname>' set up to track remote branch '<branchname>' from 'origin'.

And then the scan produces proper output

for “pull_request” event

In the checkout step

hecking out the ref
  /usr/bin/git checkout --progress --force refs/remotes/pull/28/merge
  Note: switching to 'refs/remotes/pull/28/merge'.
  You are in 'detached HEAD' state. You can look around, make experimental
  changes and commit them, and you can discard any commits you make in this
  state without impacting any branches by switching back to a branch.
  If you want to create a new branch to retain commits you create, you may
  do so (now or later) by using -c with the switch command. Example:
    git switch -c <new-branch-name>
  Or undo this operation with:
    git switch -
  Turn off this advice by setting config variable advice.detachedHead to false
  HEAD is now at 30f5291 Merge <sha> into <sha>


In the “Trufflehog” scan step

Traceback (most recent call last):
  File "/usr/local/bin/trufflehog", line 8, in <module>
  File "/usr/local/lib/python3.7/site-packages/truffleHog/truffleHog.py", line 82, in main
    surpress_output=False, branch=args.branch, repo_path=args.repo_path, path_inclusions=path_inclusions, path_exclusions=path_exclusions)
  File "/usr/local/lib/python3.7/site-packages/truffleHog/truffleHog.py", line 315, in find_strings
    branches = repo.remotes.origin.fetch(branch)
  File "/usr/local/lib/python3.7/site-packages/git/remote.py", line 792, in fetch
    res = self._get_fetch_info_from_stderr(proc, progress)
  File "/usr/local/lib/python3.7/site-packages/git/remote.py", line 676, in _get_fetch_info_from_stderr
  File "/usr/local/lib/python3.7/site-packages/git/cmd.py", line 408, in wait
    raise GitCommandError(self.args, status, errstr)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git fetch -v origin refs/pull/28/merge
  stderr: 'fatal: couldn't find remote ref refs/pull/28/merge'

I am not sure how to fix this