1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p common-updater-scripts curl jq
6 payload
=$
(jq
-cn --rawfile query
/dev
/stdin
'{"query": $query}' <<EOF | curl -s -H "Authorization: bearer $GITHUB_TOKEN" -d '@-' https://api.github.com/graphql
8 repository(owner: "yarnpkg", name: "berry") {
9 tag: refs(refPrefix: "refs/tags/@yarnpkg/cli/", first: 50, orderBy: {field: TAG_COMMIT_DATE, direction: DESC}) {
19 version
=$
(jq
-r "[.data.repository.tag.nodes[].name | select(contains(\"-\")|not)] | max_by(split(\".\") | map(tonumber))" <<< "$payload")
21 update-source-version yarn-berry
"$version"