mirror of
https://github.com/raspberrypi/rpi-update.git
synced 2026-01-20 21:13:38 +08:00
Merge pull request #19 from popcornmix/branch_hash
rpi-update: Extract git hash from artifact build from branch
This commit is contained in:
@@ -692,11 +692,13 @@ if [[ "${FW_REV}" == "" ]]; then
|
|||||||
if [[ ${FW_REV_IN} != http* ]] && [[ ! -f ${FW_REV_IN} ]]; then
|
if [[ ${FW_REV_IN} != http* ]] && [[ ! -f ${FW_REV_IN} ]]; then
|
||||||
IFS=':' read ARTIFACT BUILD <<<${FW_REV_IN}
|
IFS=':' read ARTIFACT BUILD <<<${FW_REV_IN}
|
||||||
if [[ "${BUILD}" == "" ]]; then
|
if [[ "${BUILD}" == "" ]]; then
|
||||||
BUILD="bcmrpi bcm2709 bcm2711 bcm2711_arm64"
|
BUILD="bcmrpi bcm2709 bcm2711 bcm2711_arm64 bcm2712"
|
||||||
fi
|
fi
|
||||||
if [[ "${ARTIFACT}" == pulls/* ]]; then
|
if [[ "${ARTIFACT}" == pulls/* ]]; then
|
||||||
PULL=${ARTIFACT##*/}
|
PULL=${ARTIFACT##*/}
|
||||||
ARTIFACT=$(eval curl -s "https://api.github.com/repos/raspberrypi/linux/pulls/${PULL}" | awk '/"sha":/ {gsub(/"/, "", $2); gsub(/,/, "", $2); print $2; exit}')
|
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
|
fi
|
||||||
else
|
else
|
||||||
ARTIFACT=${FW_REV_IN}
|
ARTIFACT=${FW_REV_IN}
|
||||||
|
|||||||
Reference in New Issue
Block a user