New to GitHub actions, and getting error: fatal: not a git repository. How to troubleshoot?

Hi all. I'm new to GitHub actions, and trying to add one on the server which simply saves the output of a Git command (git rev-parse HEAD). But when the action runs, it fails with with:

fatal: not a git repository (or any of the parent directories): .git

(screenshot).

How can I troubleshoot/resolve this? See below for my code.

The repo on the GitHub server does not have a .git folder, but my local repo does. As I understand, this is standard.

Of Note

  • The motivation behind this that I eventually want the GitHub action to ascertain SHA of each commit in a range of commits, using the statement: git rev-list <SHA-1>..<SHA-2>. Then, from that list of SHAs, I want to get the full path+filename of every file modified in each commit.

Thanks in advance.


My GitHub Action File (.github\workflows\github-actions-demo.yml; taken from Quickstart for GitHub Actions)

name: GitHub Actions Demo on: [push] jobs: Explore-GitHub-Actions: runs-on: ubuntu-latest steps: - run: echo "πŸŽ‰ The job was automatically triggered by a ${{ github.event_name }} event." - name: Set outputs id: vars run: echo "::$(git rev-parse HEAD)" 

submitted by /u/cag8f
[link] [comments]

Read more here: https://www.reddit.com/r/github/comments/n5bnty/new_to_github_actions_and_getting_error_fatal_not/

Content Attribution

This content was originally published by /u/cag8f at Github: social coding, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: