title: How to run git diff in github actions
body: <p>I am getting this:</p>
  <pre><code>Command failed: git diff --name-only HEAD^..HEAD
  fatal: ambiguous argument 'HEAD^..HEAD': unknown revision or path not in the working tree.
  </code></pre>
  <p>I want to run <code>git diff --name-only HEAD^..HEAD</code> in my branch to get a list of the files that were changed. It's working locally but not on GitHub actions. What must I do?</p>
  <p>My code is this:</p>
  <pre><code>name: build
  on:
    push:
      branches:
        - main
  jobs:
    run:
      name: Build
      runs-on: ubuntu-latest
      steps:
        - name: Checkout repo
          uses: actions/checkout@v2
        - name: Configure Node.js
          uses: actions/setup-node@v2
          with:
            node-version: 14.x
        - name: Install dependencies
          run: yarn install
        - name: Publish file changes to Slack
          # HERE I run `git diff` in node.js process
          run: &quot;SLACK_TOKEN=${{ secrets.GITHUB_TOKEN }} npx ts-node scripts/publishSlackUpdate&quot;
        - name: Build TOC
          run: make toc
        - name: Commit build changes
          uses: EndBug/add-and-commit@v7
          with:
            author_name: Docs Builder
            author_email: docs@mysite.com
            message: 'Updated build'
            add: '*.md'
  </code></pre>