I am getting this:
Command failed: git diff --name-only HEAD^..HEAD
fatal: ambiguous argument 'HEAD^..HEAD': unknown revision or path not in the working tree.
I want to run git diff --name-only HEAD^..HEAD 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?
My code is this:
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: "SLACK_TOKEN=${{ secrets.GITHUB_TOKEN }} npx ts-node scripts/publishSlackUpdate"
- 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'