Skip to content

Commit 2b448fe

Browse files
JAORMXclaude
andauthored
Fix proposal naming validation to only check new files (#2788)
The --diff-filter option was missing the equals sign, which could cause git to misinterpret 'A' as a path argument instead of the filter value. This resulted in the validation failing even when only updating existing proposal files. Changes: - Fix --diff-filter syntax from '--diff-filter A' to '--diff-filter=A' - Add '|| true' to grep to handle cases with no matching files - Update comments to clarify the intent 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent b97646b commit 2b448fe

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/workflows/validate-proposal-naming.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@ jobs:
3737
3838
- name: Validate proposal naming
3939
run: |
40-
# Get the list of changed files in docs/proposals
41-
CHANGED_FILES=$(git diff --name-only --diff-filter A origin/${{ github.base_ref }}...HEAD | grep '^docs/proposals/')
40+
# Get the list of NEW files added in docs/proposals (not modifications to existing files)
41+
CHANGED_FILES=$(git diff --name-only --diff-filter=A origin/${{ github.base_ref }}...HEAD | grep '^docs/proposals/' || true)
4242
43-
# This is here to avoid errors when running this workflow manually without a PR
43+
# Skip validation if no new proposal files are being added
44+
# (modifications to existing proposals don't need naming validation)
4445
if [ -z "$CHANGED_FILES" ]; then
45-
echo "ℹ️ No proposal files changed in this PR"
46+
echo "ℹ️ No new proposal files added in this PR (only modifications to existing proposals or manual trigger)"
4647
exit 0
4748
fi
4849

0 commit comments

Comments
 (0)