Skip to content

Commit e888bfc

Browse files
committed
ci: guard the Leiningen install coordinate
The release gate checked only the deps.edn coordinate form, in README.md and doc/*.md. The Leiningen form was unverified anywhere, so it could drift silently: buddy-auth shipped 5.0.0 with a guide telling Leiningen users to install 4.0.2, a release predating its OIDC audience and expiry fixes. The check is scoped to the artifact being released, so a companion coordinate in the same file (psql-clj's modules, beckon and beckon-ffm referencing each other) is left alone.
1 parent 6b3792e commit e888bfc

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,24 @@ jobs:
6969
done < <(grep -oE "net\.clojars\.[a-zA-Z0-9._/-]+ \{:mvn/version \"[^\"]+\"\}" "$f" | grep -F "$LIB {:mvn/version" | grep -oE '"[^"]+"' | tr -d '"')
7070
done
7171
exit $rc
72+
73+
- name: Verify Leiningen install coordinates match version
74+
if: github.ref_type == 'tag'
75+
run: |
76+
TAG="${GITHUB_REF_NAME#v}"
77+
LIB=$(grep -oE "net\.clojars\.[^ ')]+" build.clj | head -1)
78+
rc=0
79+
shopt -s nullglob
80+
for f in README.md doc/*.md; do
81+
[ -f "$f" ] || continue
82+
while IFS= read -r ver; do
83+
if [ "$ver" != "$TAG" ]; then
84+
echo "::error file=$f::$f pins [$LIB \"$ver\"], expected \"$TAG\""
85+
rc=1
86+
fi
87+
done < <(grep -oE "\[net\.clojars\.[a-zA-Z0-9._/-]+ \"[^\"]+\"\]" "$f" | grep -F "[$LIB \"" | grep -oE '"[^"]+"' | tr -d '"')
88+
done
89+
exit $rc
7290
- name: Verify tag commit is on main
7391
if: github.ref_type == 'tag'
7492
run: |

0 commit comments

Comments
 (0)