From dc09a3e79a315050271d00b196dd4ef71128f3d1 Mon Sep 17 00:00:00 2001 From: Murilo Dal Ri Date: Thu, 4 Jul 2024 11:46:32 +0100 Subject: [PATCH] wip --- .github/workflows/gem-bump-checker.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/gem-bump-checker.yml b/.github/workflows/gem-bump-checker.yml index b5703fa77..4751fd231 100644 --- a/.github/workflows/gem-bump-checker.yml +++ b/.github/workflows/gem-bump-checker.yml @@ -5,6 +5,11 @@ on: secrets: GH_TOKEN: required: true + inputs: + ignored_files: + description: 'JSON string of files or directories to be ignored' + required: false + type: string jobs: check-files: @@ -21,10 +26,27 @@ jobs: - name: Check for version and changelog updates env: GH_TOKEN: ${{ secrets.GH_TOKEN }} + IGNORED_FILES_JSON: ${{ inputs.ignored_files }} run: | + echo "Debug: Starting script" BASE_REF=$(git ls-remote origin HEAD | cut -f 1) + echo "Debug: BASE_REF=$BASE_REF" HEAD_REF=$(git rev-parse HEAD) + echo "Debug: HEAD_REF=$HEAD_REF" MODIFIED_FILES=$(git diff --name-only "$BASE_REF".."$HEAD_REF") + echo "Debug: MODIFIED_FILES=$MODIFIED_FILES" + + if [ -n "$IGNORED_FILES_JSON" ]; then + echo "Debug: IGNORED_FILES_JSON=$IGNORED_FILES_JSON" + IGNORED_FILES=$(echo "$IGNORED_FILES_JSON" | tr -d '[]' | tr ',' '\n' | tr -d '"') + echo "Debug: IGNORED_FILES=$IGNORED_FILES" + for file in $IGNORED_FILES; do + echo "Debug: Ignoring file=$file" + MODIFIED_FILES=$(echo "$MODIFIED_FILES" | grep -v "$file") + done + fi + + echo "Debug: Filtered MODIFIED_FILES=$MODIFIED_FILES" if ! echo "$MODIFIED_FILES" | grep 'version.rb' && \ ! echo "$MODIFIED_FILES" | grep '\.gemspec$'; then