update workflow

Workflow will stop if github internet connection not stable
This commit is contained in:
siritami
2024-03-01 01:08:04 +07:00
parent 531751f111
commit ebe3fe1b26
5 changed files with 61 additions and 8 deletions

14
src/etc/connection.sh Normal file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
# Check github connection stable or not:
check_connection() {
wget -q $(curl -s "https://api.github.com/repos/revanced/revanced-patches/releases/latest" | jq -r '.assets[] | select(.name == "patches.json") | .browser_download_url')
if [ -f patches.json ]; then
echo "internet_error=0" >> $GITHUB_OUTPUT
echo -e "\e[32mGithub connection OK\e[0m"
else
echo "internet_error=1" >> $GITHUB_OUTPUT
echo -e "\e[31mGithub connection not stable!\e[0m"
fi
}
check_connection