From 9d8ad1e2f9baedf7c86fe14b3c1fbbfedb594586 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Fri, 6 Oct 2023 19:11:57 +0100 Subject: [PATCH] rpi-update: Extract git hash from artifact build from branch This allows rpi-update rpi-6.6.y to correctly skip if no changes or run if there are changes. See: https://forums.raspberrypi.com/viewtopic.php?p=2138683#p2138683 --- rpi-update | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rpi-update b/rpi-update index 534ecdf..cbacd14 100755 --- a/rpi-update +++ b/rpi-update @@ -682,6 +682,8 @@ if [[ "${FW_REV}" == "" ]]; then if [[ "${ARTIFACT}" == pulls/* ]]; then PULL=${ARTIFACT##*/} ARTIFACT=$(eval curl -s "https://api.github.com/repos/raspberrypi/linux/pulls/${PULL}" | awk '/"sha":/ {gsub(/"/, "", $2); gsub(/,/, "", $2); print $2; exit}') + else + ARTIFACT=$(eval curl -s "https://api.github.com/repos/raspberrypi/linux/actions/artifacts" | grep -A1 "\"head_branch\": \"${FW_REV_IN}\"" | awk '/"head_sha":/ {gsub(/"/, "", $2); gsub(/,/, "", $2); print $2; exit}') fi else ARTIFACT=${FW_REV_IN}