Skip to content

Commit 6dc578f

Browse files
committed
Fix comments/greps
1 parent ea120dd commit 6dc578f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/pr-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ jobs:
6060
CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}..HEAD | grep -E "^\.github/(workflows|actions)/.*\.ya?ml$" || true)
6161
6262
if [ -n "$CHANGED_FILES" ]; then
63-
# Check for any versioned actions
64-
VIOLATIONS=$(grep -Hn "uses:.*@v" $CHANGED_FILES || true)
63+
# Check for any versioned actions, excluding comments and this validation script
64+
VIOLATIONS=$(grep -Hn "uses:.*@v" $CHANGED_FILES | grep -v "grep.*uses:.*@v" | grep -v "^\s*#" || true)
6565
if [ -n "$VIOLATIONS" ]; then
6666
echo "Found versioned GitHub actions. Use commit SHAs instead:"
6767
echo "$VIOLATIONS"

0 commit comments

Comments
 (0)