Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
eq19 committed Nov 25, 2024
1 parent aa4aa6a commit f639628
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .github/actions/4-identition/4-parser/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ runs:
env:
JOB_ID: ${{ inputs.id }}
GH_TOKEN: ${{ inputs.token }}
WORKSPACE: ${{ inputs.workspace }}
TEMP_FOLDER: ${{ inputs.runner_temp }}
GCP_TOKEN: ${{ steps.auth.outputs.id_token }}
BASE_GIT: "/d/a/_actions/eq19/eq19/v1/.github"
BASE: "https://github.com/eq19/eq19.github.io.wiki.git"
Expand Down
19 changes: 10 additions & 9 deletions .github/entrypoint/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,27 @@ if [[ "${JOB_ID}" == "3" ]]; then
echo -e "\n$hr\nWORKSPACE\n$hr"
gist.sh ${TARGET_REPOSITORY} ${FOLDER}

if [[ "${WIKI}" != "${BASE}" ]]; then
git clone $WIKI ${RUNNER_TEMP}/wikidir
mv -f ${RUNNER_TEMP}/wikidir/Home.md ${RUNNER_TEMP}/wikidir/README.md
find ${RUNNER_TEMP}/gistdir -type d -name "${FOLDER}" -prune -exec sh -c 'wiki.sh "$1"' sh {} \;
fi

find ${RUNNER_TEMP}/gistdir -type d -name .git -prune -exec rm -rf {} \;

mv -f ${RUNNER_TEMP}/workdir/* /home/runner/_site/

rm -rf ${RUNNER_TEMP}/Sidebar.md && cp _Sidebar.md ${RUNNER_TEMP}/Sidebar.md
sed -i 's/0. \[\[//g' ${RUNNER_TEMP}/Sidebar.md && sed -i 's/\]\]//g' ${RUNNER_TEMP}/Sidebar.md

cd /home/runner/_site && cp -R ${RUNNER_TEMP}/gistdir/* .
find . -iname '*.md' -print0 | sort -zn | xargs -0 -I '{}' front.sh '{}'
find . -type d -name "${FOLDER}" -prune -exec sh -c 'cat ${RUNNER_TEMP}/README.md >> $1/README.md' sh {} \;

elif [[ "${JOB_ID}" == "4" ]]; then

echo -e "\n$hr\nWORKSPACE\n$hr"

if [[ "${WIKI}" != "${BASE}" ]]; then
git clone $WIKI ${RUNNER_TEMP}/wikidir
mv -f ${RUNNER_TEMP}/wikidir/Home.md ${RUNNER_TEMP}/wikidir/README.md
find ${GITHUB_WORKSPACE} -type d -name "${FOLDER}" -prune -exec sh -c 'wiki.sh "$1"' sh {} \;
fi

find ${GITHUB_WORKSPACE} -type d -name "${FOLDER}" -prune -exec sh -c 'cat ${TEMP_FOLDER}/README.md >> $1/README.md' sh {} \;
find ${GITHUB_WORKSPACE} -iname '*.md' -print0 | sort -zn | xargs -0 -I '{}' front.sh '{}'

fi

if [[ -z ${PASS} ]] || [[ "${PASS}" == "true" ]]; then
Expand Down

0 comments on commit f639628

Please sign in to comment.