github-action-git-crypt-unlock icon indicating copy to clipboard operation
github-action-git-crypt-unlock copied to clipboard

fatal: not a git repository (or any of the parent directories): .git git-crypt: Error: 'git status' failed - is this a Git repository?

Open JohnYangSam opened this issue 11 months ago • 0 comments

I'm trying to use the action on self-hosted runner and it seems like the action doesn't recognize the git repository?

Error:

Run pwd
  pwd
  ls -a
.git
....

Run sliteteam/[email protected]
fatal: not a git repository (or any of the parent directories): .git
git-crypt: Error: 'git status' failed - is this a Git repository?

Portion of the github action .yml:

on:
  push:
    branches:
      - production
  workflow_dispatch:

permissions:
  contents: read

jobs:
  deploy:
    runs-on: self-hosted
    env:
      GIT_CRYPT_KEY: ${{ secrets.GIT_CRYPT_BH_KEY_BASE64_ENCODED }}
 # Steps
    steps:
      # Checkout latest code
      # See: https://github.com/actions/checkout
      - name: Checkout source code
        uses: actions/checkout@v4
        with:
          fetch-depth: 0 # Fetch all history so we can git-crypt unlock it

      # Init repo so we can git-crypt unlock it
      - name: Debugging
        run: |
          pwd
          ls -a

      - name: Decrypt git-crypt variables
        uses: sliteteam/[email protected]
        env:
          GIT_DISCOVERY_ACROSS_FILESYSTEM: 1

JohnYangSam avatar Feb 23 '25 01:02 JohnYangSam