Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
MuriloDalRi committed Jul 4, 2024
1 parent 093c8cf commit e888603
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/gem-bump-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit e888603

Please sign in to comment.