Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2173f53

Browse files
EdwardAngertclaude
andcommitted
refactor: improve changed files handling for Vale
- Mimic tj-actions/changed-files output format- Add both comma-separated and space-separated outputs- Better handle empty/null arrays with early exit- Improve readability with more descriptive comments🤖 Generated with [Claude Code](https://claude.ai/code)Co-Authored-By: Claude <noreply@anthropic.com>
1 parent2acea1b commit2173f53

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

‎.github/workflows/docs-unified.yaml‎

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,21 +127,29 @@ jobs:
127127
128128
# Vale style checking for documentation - only checks changed files
129129
# This is the ONLY place Vale is actually run - the action in docs-core is a placeholder
130+
# Extract and format changed files for Vale in a way similar to tj-actions/changed-files
130131
-name:Extract changed files for Vale
131132
id:extract-changed-files
132133
if:steps.docs-core-setup.outputs.needs_vale == 'true' && steps.docs-core-setup.outputs.has_changes == 'true'
133134
shell:bash
134135
run:|
135-
#Use theJSON arrayof changed files detected bydocs-core
136+
#ParseJSON arrayfromdocs-core output
136137
CHANGED_FILES_JSON='${{ steps.docs-core-setup.outputs.changed_files }}'
137-
# Convert JSON array to comma-separated list
138-
CHANGED_FILES=$(echo "$CHANGED_FILES_JSON" | jq -r 'join(",")')
139-
if [ -n "$CHANGED_FILES" ] && [ "$CHANGED_FILES" != "null" ]; then
140-
echo "Files to check: $CHANGED_FILES"
141-
echo "files_to_check=$CHANGED_FILES" >> $GITHUB_OUTPUT
142-
else
138+
139+
# Handle empty or null arrays
140+
if [ "$CHANGED_FILES_JSON" == "[]" ] || [ "$CHANGED_FILES_JSON" == "null" ]; then
143141
echo "No files to check"
142+
exit 0
144143
fi
144+
145+
# Extract files as comma-separated string (Vale action input format)
146+
CHANGED_FILES=$(echo "$CHANGED_FILES_JSON" | jq -r 'join(",")')
147+
echo "Files to check: $CHANGED_FILES"
148+
echo "files_to_check=$CHANGED_FILES" >> $GITHUB_OUTPUT
149+
150+
# Create space-separated output as well (like tj-actions/changed-files)
151+
CHANGED_FILES_SPACES=$(echo "$CHANGED_FILES_JSON" | jq -r 'join(" ")')
152+
echo "all_changed_files=$CHANGED_FILES_SPACES" >> $GITHUB_OUTPUT
145153
146154
-name:Run Vale style checks
147155
if:steps.docs-core-setup.outputs.needs_vale == 'true' && steps.extract-changed-files.outputs.files_to_check != ''

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp