diff --git a/.github/workflows/generate_docs.yml b/.github/workflows/generate_docs.yml index 257d1e6a..5ca7d06d 100644 --- a/.github/workflows/generate_docs.yml +++ b/.github/workflows/generate_docs.yml @@ -15,6 +15,7 @@ jobs: env: CHECKOUT_REF: ${{ github.ref }} GH_TOKEN: ${{ github.token }} + IS_CI: "true" steps: - name: 'Checkout' uses: actions/checkout@v2 diff --git a/CI/generate-docs.sh b/CI/generate-docs.sh index 035ba9d0..ebebcabc 100755 --- a/CI/generate-docs.sh +++ b/CI/generate-docs.sh @@ -18,6 +18,11 @@ if git diff --quiet; then exit 0 fi +# Exit if we aren't a CI run to prevent messing with the current git config +if [ -z "${IS_CI}" ]; then + exit 0 +fi + REMOTE_URL="$(git config remote.origin.url)" TARGET_REPO=${REMOTE_URL/https:\/\/github.com\//github.com/} GITHUB_REPO=https://${GH_TOKEN:-git}@${TARGET_REPO}