Fix skill-validation workflow failing when agents directory is deleted#13592
Conversation
The filter step deletes .github/agents/ when no agent files are changed in the PR. Later, the step summary and metadata steps run: find .github/agents -name '*.agent.md' 2>/dev/null | wc -l find returns exit code 1 on a missing directory. 2>/dev/null suppresses the error message but not the exit code. Under -o pipefail (set by the shell: bash --noprofile --norc -e -o pipefail), the pipeline exit code is 1. Under set -e, this terminates the script before reaching exit \\\, causing the step to report failure even though the validator printed 'All checks passed'. Add || true to all four find|wc pipelines so a missing directory produces a count of 0 instead of aborting the script. Fixes the same issue for .github/skills/ which can also be deleted when only agent files are changed.
There was a problem hiding this comment.
Pull request overview
This PR fixes a GitHub Actions workflow failure in .github/workflows/skill-validation.yml when the workflow’s filtering step removes .github/skills/ and/or .github/agents/, causing later find | wc pipelines to terminate the step under bash -e -o pipefail.
Changes:
- Make the four
find … | wc -lcount pipelines resilient to missing directories by appending|| true. - Ensure both the step summary output and the metadata/artifact output paths report counts as
0instead of failing the job.
There was a problem hiding this comment.
✅ 24/24 dimensions clean — no findings.
Summary: The || true additions are correct and necessary. GitHub Actions bash steps run with -e -o pipefail, so when find returns non-zero (directory doesn't exist), pipefail propagates the failure through wc -l, and set -e aborts the step. The fix ensures the count command substitutions always succeed while still capturing the correct wc -l output (|| true produces no stdout, so the captured value is unaffected). This is idiomatic shell and consistent with the existing || echo "(none)" pattern used elsewhere in the same workflow (lines 110-112).
Note
🔒 Integrity filter blocked 1 item
The following item were blocked because they don't meet the GitHub integrity level.
- #13592
pull_request_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
To allow these resources, lower min-integrity in your GitHub frontmatter:
tools:
github:
min-integrity: approved # merged | approved | unapproved | noneGenerated by Expert Code Review (on open) for issue #13592 · ● 2.2M
The filter step deletes .github/agents/ when no agent files are changed in the PR. Later, the step summary and metadata steps run:
find .github/agents -name '*.agent.md' 2>/dev/null | wc -lfindreturns exit code 1 on a missing directory.2>/dev/nullsuppresses the error message but not the exit code. Under-o pipefail(set by the shell:bash --noprofile --norc -e -o pipefail), the pipeline exit code is 1. Underset -e, this terminates the script before reaching exit, causing the step to report failure even though the validator printed 'All checks passed'.Add
|| trueto all fourfind|wcpipelines so a missing directory produces a count of 0 instead of aborting the script.Fixes the same issue for .github/skills/ which can also be deleted when only agent files are changed.