From d19183f442ce9c09b3939b13349d87a89c173018 Mon Sep 17 00:00:00 2001 From: cragwolfe Date: Tue, 15 Aug 2023 10:57:59 -0700 Subject: [PATCH] build(lint): don't check version in main against self (#1123) If on the main branch already, it does not make sense to check if the latest commit is the same non-dev version. This fixes an annoyance where the CI Lint job would fail on release main commits, but besides that was not causing any other issues. --- CHANGELOG.md | 4 +--- scripts/version-sync.sh | 10 ++++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2790c6c27..5ff6ad9b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,11 @@ ## 0.9.4-dev0 - ### Enhancements - ### Features - ### Fixes + * fix pdf partition of list items being detected as titles in OCR only mode ## 0.9.3 diff --git a/scripts/version-sync.sh b/scripts/version-sync.sh index 603e27f64..4843ac858 100755 --- a/scripts/version-sync.sh +++ b/scripts/version-sync.sh @@ -103,21 +103,23 @@ fi # Search files in FILES_TO_CHECK and change (or get diffs) declare FAILED_CHECK=0 +MAIN_VERSION=$(git show main:unstructured/__version__.py | grep -o -m 1 -E "${RE_SEMVER_FULL}") +MAIN_IS_RELEASE=false +[[ $MAIN_VERSION != *"-dev"* ]] && MAIN_IS_RELEASE=true +CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) + for i in "${!FILES_TO_CHECK[@]}"; do FILE_TO_CHANGE=${FILES_TO_CHECK[$i]} RE_SEMVER=${RE_SEMVERS[$i]} UPDATED_VERSION=${UPDATED_VERSIONS[$i]} FILE_VERSION=$(grep -o -m 1 -E "${RE_SEMVER}" "$FILE_TO_CHANGE") - MAIN_VERSION=$(git show main:unstructured/__version__.py | grep -o -m 1 -E "${RE_SEMVER_FULL}") - MAIN_IS_RELEASE=false - [[ $MAIN_VERSION != *"-dev"* ]] && MAIN_IS_RELEASE=true if [ -z "$FILE_VERSION" ]; then # No match to semver regex in VERSIONFILE, so nothing to replace printf "Error: No semver version found in file %s.\n" "$FILE_TO_CHANGE" exit 1 - elif [[ "$MAIN_IS_RELEASE" == true && "$FILE_VERSION" == "$MAIN_VERSION" ]]; + elif [[ "$MAIN_IS_RELEASE" == true && "$FILE_VERSION" == "$MAIN_VERSION" && "$CURRENT_BRANCH" != "main" ]]; then # Only one commit should be associated with a particular non-dev version printf "Error: there is already a commit associated with version %s.\n" "$MAIN_VERSION"