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

Change safe.directory after git init #56

Merged
merged 4 commits into from
Feb 3, 2024
Merged

Conversation

migagi
Copy link
Contributor

@migagi migagi commented Jan 16, 2024

Hi,
I changed this line:
git config --global --add safe.directory "${PWD}"

After git init, with this the GitHub action works perfec.

Thanks

@migagi
Copy link
Contributor Author

migagi commented Jan 16, 2024

I changed this line:
git config --global --add safe.directory "${PWD}"

After git init

Thanks

@benmatselby
Copy link
Owner

Hey there, thank you for this @migagi

Could you explain the issues you were seeing, and how this resolves it please?

@migagi
Copy link
Contributor Author

migagi commented Feb 3, 2024

Hi,

In github action, every step is ok less in Hugo deploy pages step produce this error:

-------------------+-----
Pages | 7
Paginator pages | 0
Non-page files | 0
Static files | 0
Processed images | 0
Aliases | 1
Sitemaps | 1
Cleaned | 0

Total in 48 ms
CNAME set to migagi.github.io, creating file CNAME
Committing the site to git and pushing
Initialized empty Git repository in /github/workspace/public/.git/
Getting hash for base repository commit
fatal: detected dubious ownership in repository at '/github/workspace/public'
To add an exception for this directory, call:

git config --global --add safe.directory /github/workspace/public

The solution for this is move "git config --global --add safe.directory "${PWD}"" after git init

And after made this change in my fork repository every step goes ok:

Total in 64 ms
CNAME set to migagi.github.io, creating file CNAME
Committing the site to git and pushing
Initialized empty Git repository in /github/workspace/public/.git/
Getting hash for base repository commit
Switched to a new branch 'main'
[main (root-commit) bf6015f] Auto publishing site from migagi/hugoDocs@080569a
15 files changed, 1367 insertions(+)
create mode 100644 404.html
create mode 100644 CNAME
create mode 100644 assets/css/stylesheet.b609c58d5c11bb90b1a54e04005d74ad1ddf22165eb79f5533967e57df9c3b50.css
create mode 100644 categories/index.html
create mode 100644 categories/index.xml
create mode 100644 index.html
create mode 100644 index.xml
create mode 100644 page/1/index.html
create mode 100644 posts/index.html
create mode 100644 posts/index.xml
create mode 100644 posts/my-first-post/index.html
create mode 100644 posts/page/1/index.html
create mode 100644 sitemap.xml
create mode 100644 tags/index.html
create mode 100644 tags/index.xml
To https://github.com/migagi/migagi.github.io.git

  • f41ab22...bf6015f main -> main (forced update)
    Complete

If you need something else tell me
please

Copy link
Owner

@benmatselby benmatselby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes perfect sense, thank you @migagi

@benmatselby benmatselby enabled auto-merge (rebase) February 3, 2024 10:47
@benmatselby benmatselby merged commit af723bc into benmatselby:main Feb 3, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants