title: Github Actions Error; cannot see git diff to Master
body: <p>I am trying to find a way to lint only markdown files that have changed on the current branch. I wrote a bash script that runs fine locally, but breaks in Github Actions.</p>
  
  <p>Expected Outcome:
  lint only markdown files that have been changed on the branch in GitHub Actions on pull-request.</p>
  
  <pre><code>#!/bin/bash
  files=`git diff --name-only master`
  for x in $files;
  do
      if [ ${x: -3} == ".md" ]
      then
          node_modules/.bin/markdownlint $x
      fi
  done
  </code></pre>
  
  <p>I call the script in package.json</p>
  
  <pre><code>"scripts": {
      "test": "bash mdlint.sh"
    }
  </code></pre>
  
  <p>I then call the bash script in GitHub Actions workflow: </p>
  
  <pre><code>name: CI
  
  on: 
    pull_request:
      branches:
      - master
  
  jobs:
    build:
      runs-on: ubuntu-latest
  
      steps:
      - uses: actions/checkout@v1
        with:
          fetch-depth: 1
      - uses: actions/setup-node@master
      - name: lint all markdownfiles
        run: |
          npm install
          npm run test
  </code></pre>
  
  <p>This is the Error in GitHub Actions: </p>
  
  <pre><code>  shell: /bin/bash -e {0}
  npm WARN Gatsby_site No repository field.
  npm WARN Gatsby_site No license field.
  
  added 33 packages from 26 contributors and audited 43 packages in 0.952s
  found 0 vulnerabilities
  
  
  &gt; @ test /home/runner/work/Gatsby_site/Gatsby_site
  &gt; bash mdlint.sh
  
  fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
  Use '--' to separate paths from revisions, like this:
  'git &lt;command&gt; [&lt;revision&gt;...] -- [&lt;file&gt;...]'
  </code></pre>
  
  <p>Is there a way to make GitHub actions run the linter only on the files that changed on the current branch? </p>