diff --git a/tools/init.sh b/tools/init.sh index 7cc6e20..c6742f1 100755 --- a/tools/init.sh +++ b/tools/init.sh @@ -51,25 +51,14 @@ init_files() { rm -rf .github else ## Change the files of `.github` - mv .github/workflows/$ACTIONS_WORKFLOW.hook . rm -rf .github mkdir -p .github/workflows mv ./${ACTIONS_WORKFLOW}.hook .github/workflows/${ACTIONS_WORKFLOW} - ## Ensure the gh-actions trigger branch - - _workflow=".github/workflows/${ACTIONS_WORKFLOW}" - _default_branch="$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')" - _lineno="$(sed -n "/branches:/=" "$_workflow")" - - sed -i.$TEMP_SUFFIX "$((_lineno + 1))s/- .*/- ${_default_branch}/" "$_workflow" - rm -f "$_workflow.$TEMP_SUFFIX" - ## Cleanup image settings in site config sed -i.$TEMP_SUFFIX "s/^img_cdn:.*/img_cdn:/;s/^avatar:.*/avatar:/" _config.yml rm -f _config.yml.$TEMP_SUFFIX - fi # trace the gem lockfile on user-end @@ -82,7 +71,7 @@ init_files() { # save changes git add -A - git commit -m "[Automation] Initialize the environment." -q + git commit -m "chore: initialize the environment" -q echo "[INFO] Initialization successful!" }