1 #! /usr/bin/env nix-shell
2 #! nix-shell -I nixpkgs=./. -i bash -p coreutils common-updater-scripts jq curl
6 currentVersion
="$(nix --extra-experimental-features nix-command eval -f . github-runner.version --raw)"
7 latestVersion
="$(curl -s -H "Accept
: application
/vnd.github.v3
+json
" \
8 ${GITHUB_TOKEN:+ -H "Authorization: bearer $GITHUB_TOKEN"} \
9 "https
://api.github.com
/repos
/actions
/runner
/releases
/latest
" | jq -r ".tag_name
")"
10 latestVersion
="${latestVersion#?}" # v2.296.2 -> 2.296.2
12 if [[ "$latestVersion" == "$currentVersion" ]]; then
13 echo "github-runner is already up to date: $currentVersion"
17 update-source-version github-runner
"$latestVersion"
18 $
(nix-build
-A github-runner.fetch-deps
--no-out-link)