Skip to content

Commit

Permalink
add helpful badges to github updater
Browse files Browse the repository at this point in the history
  • Loading branch information
theofficialgman committed Jan 20, 2023
1 parent 483a9bd commit e69f72c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/update_apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ jobs:
for app in "${changed_apps[@]}"; do
# skip checking DDNet (due to Rust) if on arm32 under QEMU: https://github.com/rust-lang/cargo/issues/8719
if [ "$app" != "DDNet" ]; then
./manage install "$app" || { git checkout -- "apps/$app"; echo "**Failed to install $app, reverting to previous version.**" >> /tmp/failed_update_apps; UPDATED_APPS=$(echo "$UPDATED_APPS" | sed "/$app/d"); }
./manage uninstall "$app" || { git checkout -- "apps/$app"; echo "**Failed to uninstall $app, reverting to previous version.**" >> /tmp/failed_update_apps; UPDATED_APPS=$(echo "$UPDATED_APPS" | sed "/$app/d"); }
./manage install "$app" || { git checkout -- "apps/$app"; echo '> ![badge-error][badge-error]'" Failed to install $app, reverting to previous version." >> /tmp/failed_update_apps; UPDATED_APPS=$(echo "$UPDATED_APPS" | sed "/$app/d"); }
./manage uninstall "$app" || { git checkout -- "apps/$app"; echo '> ![badge-error][badge-error]'" Failed to uninstall $app, reverting to previous version." >> /tmp/failed_update_apps; UPDATED_APPS=$(echo "$UPDATED_APPS" | sed "/$app/d"); }
fi
done
Expand Down Expand Up @@ -227,8 +227,8 @@ jobs:
# attempt to install updated apps using manage script loop
# if any app fails, checkout the previous version and add it to the /tmp/failed_update_apps file
for app in "${changed_apps[@]}"; do
./manage install "$app" || { git checkout -- "apps/$app"; echo "**Failed to install $app, reverting to previous version.**" >> /tmp/failed_update_apps; UPDATED_APPS=$(echo "$UPDATED_APPS" | sed "/$app/d"); }
./manage uninstall "$app" || { git checkout -- "apps/$app"; echo "**Failed to uninstall $app, reverting to previous version.**" >> /tmp/failed_update_apps; UPDATED_APPS=$(echo "$UPDATED_APPS" | sed "/$app/d"); }
./manage install "$app" || { git checkout -- "apps/$app"; echo '> ![badge-error][badge-error]'" Failed to install $app, reverting to previous version." >> /tmp/failed_update_apps; UPDATED_APPS=$(echo "$UPDATED_APPS" | sed "/$app/d"); }
./manage uninstall "$app" || { git checkout -- "apps/$app"; echo '> ![badge-error][badge-error]'" Failed to uninstall $app, reverting to previous version." >> /tmp/failed_update_apps; UPDATED_APPS=$(echo "$UPDATED_APPS" | sed "/$app/d"); }
done
if test -f /tmp/failed_update_apps; then
Expand All @@ -251,6 +251,11 @@ jobs:
branch: "auto-app-updates-NOT-FOR-USERS"
title: "[AUTO] Update App Versions"
body: |
[badge-error]: https://github.com/Mqxx/GitHub-Markdown/blob/main/blockquotes/badge/error.svg?raw=true 'Error'
[badge-warning]: https://github.com/Mqxx/GitHub-Markdown/blob/main/blockquotes/badge/warning.svg?raw=true 'Warning'
[badge-issue]: https://github.com/Mqxx/GitHub-Markdown/blob/main/blockquotes/badge/issue.svg?raw=true 'Issue'
[badge-check]: https://github.com/Mqxx/GitHub-Markdown/blob/main/blockquotes/badge/check.svg?raw=true 'Check'
[badge-info]: https://github.com/Mqxx/GitHub-Markdown/blob/main/blockquotes/badge/info.svg?raw=true 'Info'
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action.
Workflow run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
Apps updated:
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/update_github_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ if [ -n "$pi_apps_ver_32" ] && [ -a "$DIRECTORY/apps/$app_name/install-32" ]; t
status "Pi-Apps install-32 version for $app_name is current!"
if ! validate_url "$armhf_url"; then
warning "Current $app_name install-32 may be broken, the upstream file $armhf_url does NOT exist."
echo "**Current $app_name install-32 may be broken, the upstream file $armhf_url does NOT exist.**" >> /tmp/failed_apps
echo '> ![badge-warning][badge-warning]'" Current $app_name install-32 may be broken, the upstream file $armhf_url does NOT exist." >> /tmp/failed_apps
fi
else
#If version is not current do:
Expand All @@ -78,7 +78,7 @@ if [ -n "$pi_apps_ver_32" ] && [ -a "$DIRECTORY/apps/$app_name/install-32" ]; t
echo "- $app_name-armhf: $pi_apps_ver_32 -> ${webVer} " >> /tmp/updated_apps
else
warning "Updating $app_name install-32 had been skipped, the upstream file $armhf_url does NOT exist."
echo "**Updating $app_name install-32 had been skipped, the upstream file $armhf_url does NOT exist.**" >> /tmp/failed_apps
echo '> ![badge-warning][badge-warning]'" Updating $app_name install-32 had been skipped, the upstream file $armhf_url does NOT exist." >> /tmp/failed_apps
fi
fi
fi
Expand All @@ -91,7 +91,7 @@ if [ -n "$pi_apps_ver_64" ] && [ -a "$DIRECTORY/apps/$app_name/install-64" ]; th
status "Pi-Apps install-64 version for $app_name is current!"
if ! validate_url "$arm64_url"; then
warning "Current $app_name install-64 may be broken, the upstream file $arm64_url does NOT exist."
echo "**Current $app_name install-64 may be broken, the upstream file $arm64_url does NOT exist.**" >> /tmp/failed_apps
echo '> ![badge-warning][badge-warning]'" Current $app_name install-64 may be broken, the upstream file $arm64_url does NOT exist." >> /tmp/failed_apps
fi
else
if validate_url "$arm64_url"; then
Expand All @@ -100,7 +100,7 @@ if [ -n "$pi_apps_ver_64" ] && [ -a "$DIRECTORY/apps/$app_name/install-64" ]; th
echo "- $app_name-arm64: $pi_apps_ver_64 -> ${webVer} " >> /tmp/updated_apps
else
warning "Updating $app_name install-64 had been skipped, the upstream file $arm64_url does NOT exist."
echo "**Updating $app_name install-64 had been skipped, the upstream file $arm64_url does NOT exist.**" >> /tmp/failed_apps
echo '> ![badge-warning][badge-warning]'" Updating $app_name install-64 had been skipped, the upstream file $arm64_url does NOT exist." >> /tmp/failed_apps
fi
fi
fi
Expand All @@ -113,7 +113,7 @@ if [ -n "$pi_apps_ver" ] && [ -n "$all_url" ] && [ -a "$DIRECTORY/apps/$app_name
status "Pi-Apps install version for $app_name is current!"
if ! validate_url "$all_url"; then
warning "Current $app_name install may be broken, the upstream file $all_url does NOT exist."
echo "**Current $app_name install may be broken, the upstream file $all_url does NOT exist.**" >> /tmp/failed_apps
echo '> ![badge-warning][badge-warning]'" Current $app_name install may be broken, the upstream file $all_url does NOT exist." >> /tmp/failed_apps
fi
else
if validate_url "$all_url"; then
Expand All @@ -122,7 +122,7 @@ if [ -n "$pi_apps_ver" ] && [ -n "$all_url" ] && [ -a "$DIRECTORY/apps/$app_name
echo "- $app_name-all: $pi_apps_ver -> ${webVer} " >> /tmp/updated_apps
else
warning "Updating $app_name install had been skipped, the upstream file $all_url does NOT exist."
echo "**Updating $app_name install had been skipped, the upstream file $all_url does NOT exist.**" >> /tmp/failed_apps
echo '> ![badge-warning][badge-warning]'" Updating $app_name install had been skipped, the upstream file $all_url does NOT exist." >> /tmp/failed_apps
fi
fi
fi
Expand All @@ -135,7 +135,7 @@ if [ -n "$pi_apps_ver" ] && [ -n "$armhf_url" ] && [ -n "$arm64_url" ] && [ -a "
status "Pi-Apps install version for $app_name is current!"
if ! ( validate_url "$armhf_url" && validate_url "$arm64_url" ); then
warning "Current $app_name install may be broken, the upstream file $armhf_url or $arm64_url does NOT exist."
echo "**Current $app_name install may be broken, the upstream file $armhf_url or $arm64_url does NOT exist.**" >> /tmp/failed_apps
echo '> ![badge-warning][badge-warning]'" Current $app_name install may be broken, the upstream file $armhf_url or $arm64_url does NOT exist." >> /tmp/failed_apps
fi
else
if validate_url "$armhf_url" && validate_url "$arm64_url"; then
Expand All @@ -144,7 +144,7 @@ if [ -n "$pi_apps_ver" ] && [ -n "$armhf_url" ] && [ -n "$arm64_url" ] && [ -a "
echo "- $app_name-all: $pi_apps_ver -> ${webVer} " >> /tmp/updated_apps
else
warning "Updating $app_name install had been skipped, the upstream file $armhf_url or $arm64_url does NOT exist."
echo "**Updating $app_name install had been skipped, the upstream file $armhf_url or $arm64_url does NOT exist.**" >> /tmp/failed_apps
echo '> ![badge-warning][badge-warning]'" Updating $app_name install had been skipped, the upstream file $armhf_url or $arm64_url does NOT exist." >> /tmp/failed_apps
fi
fi
fi
Expand All @@ -153,7 +153,7 @@ done
else

warning "webVer variable is missing for $app_name update script, please fix this script, skipping update check."
echo "**webVer variable is missing for $app_name update script, please fix this script, skipping update check.**" >> /tmp/failed_apps
echo '> ![badge-issue][badge-issue]'" webVer variable is missing for $app_name update script, please fix this script, skipping update check." >> /tmp/failed_apps

fi

Expand Down

0 comments on commit e69f72c

Please sign in to comment.