File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -224,16 +224,24 @@ function mr::pat2token {
224224# $?: 0 if successful and non-zero otherwise
225225# stdout: local path of downloaded file
226226function mr::downloadRunner {
227- local url=" $MR_RELEASE_URL " tarpath=' '
227+ local url=" $MR_RELEASE_URL " tarpath=' ' arch= ' '
228228
229229 if [[ -z " $url " ]]; then
230230 run::exists jq || return $?
231+
232+ # Detect architecture
233+ case " $( uname -m) " in
234+ x86_64) arch=" x64" ;;
235+ aarch64|arm64) arch=" arm64" ;;
236+ * ) log::_ ERROR " Unsupported architecture: $( uname -m) " && return 1 ;;
237+ esac
238+
231239 curlArgs=(-Lsm 3 --retry 1)
232240 # https://github.com/vbem/multi-runners/pull/16
233241 [[ -n " $MR_GITHUB_PAT " ]] && curlArgs+=(' -H' " Authorization: Bearer ${MR_GITHUB_PAT} " )
234242 url=" $(
235243 curl " ${curlArgs[@]} " https://api.github.com/repos/actions/runner/releases/latest \
236- | jq -Mcre ' .assets[].browser_download_url|select(test("linux-x64 -[^-]+\\.tar\\.gz"))'
244+ | jq -Mcre " .assets[].browser_download_url|select(test(\ " linux-${arch} -[^-]+\\\\ .tar\\\\ .gz\ " ))"
237245 ) " || log::failed $? " Fetching latest version number failed, check PAT or rate limit!" || return $?
238246 fi
239247
You can’t perform that action at this time.
0 commit comments