Skip to content

fatal: not a git repository (or any parent up to mount point /github) #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
scott-doyland-burrows opened this issue Feb 7, 2023 · 1 comment · Fixed by #138
Closed
Labels
bug Something isn't working

Comments

@scott-doyland-burrows
Copy link

scott-doyland-burrows commented Feb 7, 2023

Please see the screenshot:
image

I run a workflow, that calls a reusable workflow, that in turn calls a composite action, and in turn that composite calls the tf docs action. The tf docs action eventually gets run like this:

- name: Terraform docs
   if: github.event_name == 'pull_request'
   uses: terraform-docs/[email protected]
   with:
     working-dir: ./terraform/terraform
     output-method: replace

My repo is checked out to a terraform directory, and in that I have a directory named terraform where the tf code is, like this:

- name: Checkout Code on PR
  if: |
  inputs.CodeCheckout == 'true' &&
  github.event_name == 'pull_request'
  uses: actions/checkout@v3
  with:
    path: terraform
    ref: ${{ github.event.pull_request.head.ref }}

I know the checkout is working OK as I can run terraform itself.

This is running on a ubuntu-latest github hosted runner.

I did some testing and can see the README.md is updated (ran a cat of the file from the github hosted runner after the failed tf docs action).

I have tried various settings for the tf docs action, such as find-dir, altering the working-dir (such as removing the ./ from the directory name), but it always fails with the same issue.

@scott-doyland-burrows scott-doyland-burrows added the bug Something isn't working label Feb 7, 2023
@timothyclarke
Copy link

I've encountered this one as well. My use case is having custom checkov rules in a different repo.

I believe the following in relation to this issue

I can see obvious issues with dual use of working-dir so perhaps a git-checkout-dir arg

The problem may also be https://github.com/terraform-docs/gh-actions/blob/main/src/docker-entrypoint.sh#L155 having no way to alter the GITHUB_WORKSPACE env var

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants