From 9be9bf4a88aec3f2cfa4ca938060f2ba11027e3d Mon Sep 17 00:00:00 2001 From: Chris Ho Date: Fri, 28 Jul 2023 11:00:48 +0800 Subject: [PATCH] ignore the apis info file --- .drone.yml | 2 +- scripts/ignore-openapi | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 745f15702ee..9a50e47b9da 100644 --- a/.drone.yml +++ b/.drone.yml @@ -42,7 +42,7 @@ steps: path: /var/run/docker.sock - name: preview - image: chhooo/drone-netlify:v0.1.1 + image: ghcr.io/harvester/drone-netlify:master environment: BUILD_ZIP_FILE: "build.zip" NETLIFY_AUTH_TOKEN: diff --git a/scripts/ignore-openapi b/scripts/ignore-openapi index debb42953e5..3f52a43873f 100755 --- a/scripts/ignore-openapi +++ b/scripts/ignore-openapi @@ -10,10 +10,14 @@ if echo "$FILES" | grep -q "api/swagger.json"; then # perform re-generate and check for dirty files yarn clean-api-docs all yarn gen-api-docs all - if [ -n "$(git status --porcelain --untracked-files=no)" ]; then + dirty_files=$(git status --porcelain --untracked-files=no) + lines_count=$(echo "$dirty_files" | wc -l) + if [ "$lines_count" -gt 1 ] || { [ "$lines_count" -eq 1 ] && [[ "$dirty_files" != *"harvester-apis.info.mdx"* ]]; }; then echo "Error: Found dirty files. Please resolve the issues before continuing." exit 1 fi + + git reset --hard HEAD exit 0 fi