From 4c71ac83c6813cedc490c6105347d82e0c967722 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Thu, 12 Dec 2024 12:13:57 +1100 Subject: [PATCH] fixup! feat(ci): go list check versions available for untagged dependencies --- .github/workflows/dependency-check.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dependency-check.yml b/.github/workflows/dependency-check.yml index 8fd7d480e1..2c554ab1f1 100644 --- a/.github/workflows/dependency-check.yml +++ b/.github/workflows/dependency-check.yml @@ -36,7 +36,8 @@ jobs: DEPENDENCIES: ${{ steps.all.outputs.dependencies }} run: | echo "dependencies<> $GITHUB_OUTPUT - grep -Pv "$V0_PATTERN|$RELEASE_PATTERN" <<< "$DEPENDENCIES" | tee -a $GITHUB_OUTPUT + # Strip '// indirect' so we all dependencies the same + sed 's/\/\/\s*indirect//' <<< "$DEPENDENCIES" | grep -Pv "$V0_PATTERN|$RELEASE_PATTERN" | tee -a $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - name: Extract unexplained dependencies @@ -52,9 +53,10 @@ jobs: id: v0check run: | echo "tagged<> $GITHUB_OUTPUT - grep -P "$V0_PATTERN" go.mod | grep -Pv "$IGNORE_PATTERN" | while read -r line; do + # Only check direct dependencies - exclude indirect ones entirely + grep -P "$V0_PATTERN" go.mod | grep -Pv "$IGNORE_PATTERN" | grep -Pv "\/\/\s*indirect/" | while read -r line; do dep=$(echo "$line" | cut -d' ' -f1) - if [ ! -z "$(go list -m -versions $dep 2>/dev/null)" ]; then + if [ ! -z "$(go list -m -versions $dep 2>/dev/null | awk 'NF>1')" ]; then echo "$dep" fi done | tee -a $GITHUB_OUTPUT