Skip to content

Commit f23b096

Browse files
committed
autopif: fix order
1 parent 8c01319 commit f23b096

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/autopif.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ jobs:
3838
# Extract device information
3939
grep -A1 'tr id=' PIXEL_OTA_HTML | grep 'td' | sed 's;.*<td>\(.*\)</td>;\1;' | sed 's/^[[:space:]]*//g;s/[[:space:]]*$//g' > MODEL_LIST
4040
grep -o 'tr id="[^\"]*"' PIXEL_OTA_HTML | awk -F\" '{print $2 "_beta"}' | sed 's/^[[:space:]]*//g;s/[[:space:]]*$//g' > PRODUCT_LIST
41-
grep 'ota/.*_beta' PIXEL_OTA_HTML | cut -d\" -f2 > OTA_LIST
41+
for i in $(cat PRODUCT_LIST); do
42+
OTA_LINK=$(grep "ota/$i" PIXEL_OTA_HTML | cut -d\" -f2 || echo "")
43+
echo "$OTA_LINK" >> OTA_LIST
44+
done
4245
4346
CURRENT_HASH=$(sha256sum OTA_LIST | cut -d' ' -f1)
4447
LAST_HASH=$(cat ../HASH || echo '')
@@ -49,7 +52,7 @@ jobs:
4952
echo "ota_hash=$CURRENT_HASH" >> $GITHUB_OUTPUT
5053
else
5154
echo "need_update=true" >> $GITHUB_OUTPUT
52-
matrix_json=$(paste -d ',' MODEL_LIST PRODUCT_LIST OTA_LIST | jq -R 'split(",") | {model: .[0], product: .[1], ota_link: .[2]}' | jq -s . | jq -c '{include: .}')
55+
matrix_json=$(paste -d ',' MODEL_LIST PRODUCT_LIST OTA_LIST | jq -R 'split(",") | {model: .[0], product: .[1], ota_link: .[2]}' | jq -s '{include: [.[] | select(.ota_link != "")]}' | jq -c .)
5356
echo "matrix=$matrix_json" >> $GITHUB_OUTPUT
5457
echo "ota_hash=$CURRENT_HASH" >> $GITHUB_OUTPUT
5558
fi
@@ -144,5 +147,5 @@ jobs:
144147
git config --global user.email "github-actions[bot]@users.noreply.github.com"
145148
git config --global user.name "github-actions[bot]"
146149
147-
git add device_prop/** device_list.json HASH
150+
git add device_prop/. device_list.json HASH
148151
git commit -m "update device list" && git push

0 commit comments

Comments
 (0)