EndBug / add-and-commit

:octocat: Automatically commit changes made in your workflow run directly to your repo
MIT License
1.12k stars 115 forks source link

Error with repository ownership #556

Closed Eric-Jalal closed 10 months ago

Eric-Jalal commented 11 months ago

With these arguments:

  with:
    author_name: Github
    default_author: github_actor
    message: Convert new logos
    push: true

I'm getting this error:


Error: fatal: detected dubious ownership in repository at '/__w/my-repo-name/my-repo-name'
To add an exception for this directory, call:

    git config --global --add safe.directory /__w/my-repo-name/my-repo-name

And can I enter raw git commands in this step? or I have to make another step if the only way through this is to add that exception for this directory?

EndBug commented 11 months ago

Hey, how are you checking out the repo? Can you share your workflow and logs?

Eric-Jalal commented 11 months ago
      - name: Add repository ownership exception
        run: |
          git config --global --add safe.directory /__w/my-repo/my-repo

      - name: Commit converted resources
        uses: my-own-actions/add-and-commit@main
        with:
          author_name: Github
          default_author: github_actor
          message: Convert new logos
          push: true

I added the ownership exception and even with that it says working tree is clean

EndBug commented 11 months ago

Can you share your workflow and/or a link to the action run? I need to see how you are checking out the repo (so the step that calls actions/checkout, or the git commands you're using) to be able to help you

github-actions[bot] commented 10 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.