shalzz / zola-deploy-action

Github action for building a Zola site and deploying to Github Pages
MIT License
234 stars 91 forks source link

Improve fix and add another env variable #55

Closed RobWalt closed 1 year ago

RobWalt commented 1 year ago

This PR improves the fix of the workflow by further refining the configuration of git. Instead of setting all directories as safe directories with

git config --global --add safe.directory "*"

it only adds the needed directories and lists them explicitly.


Additionally this PR fixes the same thing as #48 , but in a configurable way. The PULL_BRANCH_NAME can now be specified as another environment variable. For newer repos, it defaults to main, hence I chose that default value. If you are using master as your source code branch, you have to explicitly specify that. Now that I'm explaining that, I should probably add an additional note in the README...

shalzz commented 1 year ago

Hi, The git checkout and branch selection is handled by the official github checkout action and the defaults set by it. But you're right the script shouldn't have the branch name "master" hardcoded at line 95.

For the rest of the changes involving safe.directory, can you create a separate PR for it.

RobWalt commented 1 year ago

Ok, I'll create two separate PRs for this then.

Just a side note: The PULL_BRANCH_NAME env variable also is responsible for setting the defaultBranch in the git configuration in entrypoint.sh since this generated a warning.

RobWalt commented 1 year ago

Closing this because of #57 and #58