-
Notifications
You must be signed in to change notification settings - Fork 138
Fix Vale CI file scoping and remove dead eBPF tutorial link #2580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -12,12 +12,14 @@ jobs: | |||||||||||||
| - name: Get changed files | ||||||||||||||
| id: changed | ||||||||||||||
| run: | | ||||||||||||||
| FILES=$(git diff --name-only --diff-filter=d ${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }} -- '*.md' '*.mdx' | tr '\n' ' ') | ||||||||||||||
| echo "files=$FILES" >> "$GITHUB_OUTPUT" | ||||||||||||||
| FILES=$(git diff --name-only --diff-filter=d ${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }} -- '*.md' '*.mdx') | ||||||||||||||
| if [ -z "$FILES" ]; then | ||||||||||||||
| echo "skip=true" >> "$GITHUB_OUTPUT" | ||||||||||||||
| echo 'files=all' >> "$GITHUB_OUTPUT" | ||||||||||||||
| else | ||||||||||||||
| echo "skip=false" >> "$GITHUB_OUTPUT" | ||||||||||||||
| JSON=$(echo "$FILES" | jq -R -s -c 'split("\n") | map(select(. != ""))') | ||||||||||||||
| echo "files=$JSON" >> "$GITHUB_OUTPUT" | ||||||||||||||
| fi | ||||||||||||||
| - name: Enable Corepack | ||||||||||||||
| if: steps.changed.outputs.skip == 'false' | ||||||||||||||
|
|
@@ -38,7 +40,7 @@ jobs: | |||||||||||||
| if: steps.changed.outputs.skip == 'false' | ||||||||||||||
| run: | | ||||||||||||||
| sudo apt-get install ripgrep | ||||||||||||||
| FILES="${{ steps.changed.outputs.files }}" | ||||||||||||||
| FILES=$(echo '${{ steps.changed.outputs.files }}' | jq -r '.[]' | tr '\n' ' ') | ||||||||||||||
|
||||||||||||||
| if [ -n "$FILES" ]; then | ||||||||||||||
| rg -l0 '\$\[[^\]]*\]' -- $FILES | xargs -0 perl -i -pe 's/\$\[[^\]]*\]/PICKLEVAR/g' || true | ||||||||||||||
|
Comment on lines
+43
to
45
|
||||||||||||||
| FILES=$(echo '${{ steps.changed.outputs.files }}' | jq -r '.[]' | tr '\n' ' ') | |
| if [ -n "$FILES" ]; then | |
| rg -l0 '\$\[[^\]]*\]' -- $FILES | xargs -0 perl -i -pe 's/\$\[[^\]]*\]/PICKLEVAR/g' || true | |
| FILES=$(echo '${{ steps.changed.outputs.files }}' | jq -r '.[]') | |
| if [ -n "$FILES" ]; then | |
| printf '%s\n' "$FILES" | rg -l0 '\$\[[^\]]*\]' --files-from - | xargs -0 perl -i -pe 's/\$\[[^\]]*\]/PICKLEVAR/g' || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When no markdown files are changed (
skip=true), the code setsfiles=allon line 18. However, all subsequent steps that consume this output are gated onsteps.changed.outputs.skip == 'false', so this value is never actually used. The string'all'being stored as a fallback is misleading and potentially dangerous: if theskipcondition ever fails to propagate correctly or is evaluated unexpectedly, the Vale action would receivefiles: all(a literal string, not a valid file path) rather than the intended JSON array, causing unpredictable behavior. Thefiles=allline should simply be omitted from theskip=truebranch since it serves no purpose.