From f869380074b0d1097e7259a3e16d198b9bce36a5 Mon Sep 17 00:00:00 2001 From: Shea Phillips Date: Tue, 12 Mar 2024 20:59:27 -0700 Subject: [PATCH] DEVX-1278 add set-safe-directory config to meet requirement for last change plugin --- .github/workflows/publish_docs.yml | 1 - entrypoint.sh | 11 +++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish_docs.yml b/.github/workflows/publish_docs.yml index 5fec0a8..5f3c0f1 100644 --- a/.github/workflows/publish_docs.yml +++ b/.github/workflows/publish_docs.yml @@ -23,7 +23,6 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - set-safe-directory: 'true' - name: Build TechDocs uses: bcgov/devhub-techdocs-publish@stable id: build_and_publish diff --git a/entrypoint.sh b/entrypoint.sh index 8e70e72..661bb1a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -41,6 +41,17 @@ export AWS_REGION="$INPUT_S3_REGION" ENTITY_PATH="$ENTITY_NAMESPACE/$ENTITY_KIND/$ENTITY_NAME" +echo "Setting git configuration..." +git config --global --add safe.directory ./docs + +# when running within an Action this won't exist, but it may when testing locally +if [ ! -d "./site" ]; then + echo "Creating ./site directory." + mkdir site +fi + +git config --global --add safe.directory ./site + echo "Building TechDocs from Markdown for entity '$ENTITY_NAMESPACE/$ENTITY_KIND/$ENTITY_NAME'" techdocs-cli build --verbose --no-docker