handheld-daemon-ui: 3.2.3 -> 3.3.0 (#361609)
[NixPkgs.git] / pkgs / development / tools / yarn-berry / update.sh
blob5ce8bc02c9571e2bd49ebb57dddf6a16b4d5ff0a
1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p common-updater-scripts curl jq
4 set -eou pipefail
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}) {
10 nodes {
11 name
16 EOF
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"