diff --git a/.github/workflows/dependency-check.yml b/.github/workflows/dependency-check.yml index 2c554ab1f1..3c4198dcb3 100644 --- a/.github/workflows/dependency-check.yml +++ b/.github/workflows/dependency-check.yml @@ -12,8 +12,8 @@ jobs: runs-on: ubuntu-latest name: Dependency Check env: - V0_PATTERN: 'v0\.0\.0-[0-9]{14}-[0-9a-f]{7,}$' - RELEASE_PATTERN: 'v[0-9]+\.[0-9]+\.[0-9]+(\+incompatible)?$' + V0_PATTERN: 'v0\.0\.0-[0-9]{14}-[0-9a-f]{7,}(\s*(\/\/.*)?)?$' + RELEASE_PATTERN: 'v[0-9]+\.[0-9]+\.[0-9]+(\+incompatible)?(\s*(\/\/.*)?)?$' IGNORE_PATTERN: 'dependency-check-ignore:\s' steps: @@ -36,8 +36,7 @@ jobs: DEPENDENCIES: ${{ steps.all.outputs.dependencies }} run: | echo "dependencies<> $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 + grep -Pv "$V0_PATTERN|$RELEASE_PATTERN" <<< "$DEPENDENCIES" | tee -a $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - name: Extract unexplained dependencies @@ -53,10 +52,9 @@ jobs: id: v0check run: | echo "tagged<> $GITHUB_OUTPUT - # 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 + grep -P "$V0_PATTERN" go.mod | grep -Pv "$IGNORE_PATTERN" | while read -r line; do dep=$(echo "$line" | cut -d' ' -f1) - if [ ! -z "$(go list -m -versions $dep 2>/dev/null | awk 'NF>1')" ]; then + if [ ! -z "$(go list -m -versions $dep 2>/dev/null)" ]; then echo "$dep" fi done | tee -a $GITHUB_OUTPUT