Skip to content
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

"fatal: not in a git directory" after several successful runs #49

Closed
jmlemetayer opened this issue Dec 15, 2022 · 12 comments · Fixed by #50
Closed

"fatal: not in a git directory" after several successful runs #49

jmlemetayer opened this issue Dec 15, 2022 · 12 comments · Fixed by #50
Labels
bug Something isn't working

Comments

@jmlemetayer
Copy link
Contributor

The actions were working correctly, and during the last run the error "fatal : not in a git directory" appeared.

The faulty run:
https://github.com/jmlemetayer/project-release/actions/runs/3699984553/jobs/6267948063

The last modification of the workflow was the update of the "actions/checkout" to v3.2.0 (done by the github-actions-version-updater):
jmlemetayer/project-release@a0a4dfd

@GopikaV24
Copy link

GopikaV24 commented Dec 16, 2022

We are also facing same issue. @saadmk11 Can you please help us?

@saadmk11
Copy link
Owner

@GopikaV24 Can you please share your workflow file content?

@GopikaV24
Copy link

Please refer this,

name: GitHub Actions Version Updater

# Controls when the action will run.
on: workflow_dispatch

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3
        with:
          # [Required] Access token with `workflow` scope.
          token: ${{ secrets.WORKFLOW_SECRET }}

      - name: Run GitHub Actions Version Updater
        uses: saadmk11/github-actions-version-updater@v0.7.0
        with:
          # [Required] Access token with `workflow` scope.
          token: ${{ secrets.WORKFLOW_SECRET }}
          extra_workflow_locations: "./workflows"

@saadmk11
Copy link
Owner

Please check if running this command before running GitHub Actions Version Updater works for you

git config --global --add safe.directory "$GITHUB_WORKSPACE"

- uses: actions/checkout@v3
  with:
    # [Required] Access token with `workflow` scope.
    token: ${{ secrets.WORKFLOW_SECRET }}

- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

- name: Run GitHub Actions Version Updater
  uses: saadmk11/github-actions-version-updater@v0.7.0
  with:
    # [Required] Access token with `workflow` scope.
    token: ${{ secrets.WORKFLOW_SECRET }}
    extra_workflow_locations: "./workflows"

ref:

@GopikaV24
Copy link

Same issue again.

@jmlemetayer
Copy link
Contributor Author

@jmlemetayer
Copy link
Contributor Author

I have tried to revert the "actions/checkout" to v3.1.0: jmlemetayer/project-release@350fddd

But it still failing: https://github.com/jmlemetayer/project-release/actions/runs/3713459678/jobs/6296129467

@saadmk11
Copy link
Owner

I have added a PR for this here: #50

@jmlemetayer @GopikaV24 Please check if this solves the issue for you.

Use:

uses: saadmk11/github-actions-version-updater@safe-dir

@rajitha66
Copy link

Now its working fine using uses: saadmk11/github-actions-version-updater@safe-dir @saadmk11. Thanks

@jmlemetayer
Copy link
Contributor Author

jmlemetayer commented Dec 19, 2022

I confirm that it works for me too:
https://github.com/jmlemetayer/project-release/actions/runs/3730488646/jobs/6327603839

@saadmk11 Can you make a branch with both #50 and #40 as a final test ?

@saadmk11
Copy link
Owner

@saadmk11
Copy link
Owner

Hi everyone, I have just released https://github.com/saadmk11/github-actions-version-updater/releases/tag/v0.7.2. This should fix the issue you were facing. Please update to saadmk11/github-actions-version-updater@v0.7.2 and feel free to re-open if the issue persists. :)

xiehan added a commit to hashicorp/terraform-cdk that referenced this issue Jan 3, 2023
xiehan added a commit to cdktf/cdktf-repository-manager that referenced this issue Jan 3, 2023
DanielMSchmidt pushed a commit to hashicorp/terraform-cdk that referenced this issue Jan 3, 2023
mergify bot pushed a commit to cdktf/cdktf-repository-manager that referenced this issue Jan 9, 2023
@saadmk11 saadmk11 unpinned this issue Aug 5, 2023
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
4 participants