Skip to content

Commit 47635e4

Browse files
committed
fix(context-ledger): improve loop prevention logic robustness
1 parent 385ecd6 commit 47635e4

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

action.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,18 @@ runs:
113113
echo "should_skip=true" >> $GITHUB_OUTPUT
114114
echo "skip_reason=changelog_only_commit" >> $GITHUB_OUTPUT
115115
# Check if only changelog files were modified in the entire PR
116-
elif echo "$CHANGED_FILES" | grep -v -E '(CHANGELOG\.md|.*CHANGELOG\.md)$' | grep -q '.'; then
117-
echo "Non-changelog files were modified - proceeding with changelog automation"
118-
echo "should_skip=false" >> $GITHUB_OUTPUT
119116
else
120-
echo "🔄 Only changelog files were modified in entire PR - skipping"
121-
echo "should_skip=true" >> $GITHUB_OUTPUT
122-
echo "skip_reason=changelog_only_pr" >> $GITHUB_OUTPUT
117+
# Filter out changelog files and check if anything remains
118+
NON_CHANGELOG_FILES=$(echo "$CHANGED_FILES" | grep -v -E '(CHANGELOG\.md|.*CHANGELOG\.md)$' || true)
119+
if [ -n "$NON_CHANGELOG_FILES" ]; then
120+
echo "Non-changelog files were modified - proceeding with changelog automation"
121+
echo "Non-changelog files: $NON_CHANGELOG_FILES"
122+
echo "should_skip=false" >> $GITHUB_OUTPUT
123+
else
124+
echo "🔄 Only changelog files were modified in entire PR - skipping"
125+
echo "should_skip=true" >> $GITHUB_OUTPUT
126+
echo "skip_reason=changelog_only_pr" >> $GITHUB_OUTPUT
127+
fi
123128
fi
124129
125130
- name: Skip notification

0 commit comments

Comments
 (0)