Skip to content

Commit

Permalink
fixup! feat(ci): go list check versions available for untagged depend…
Browse files Browse the repository at this point in the history
…encies
  • Loading branch information
rvagg committed Dec 12, 2024
1 parent 4086da1 commit 4c71ac8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/dependency-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ jobs:
DEPENDENCIES: ${{ steps.all.outputs.dependencies }}
run: |
echo "dependencies<<EOF" >> $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
Expand All @@ -52,9 +53,10 @@ jobs:
id: v0check
run: |
echo "tagged<<EOF" >> $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
Expand Down

0 comments on commit 4c71ac8

Please sign in to comment.