-
-
Notifications
You must be signed in to change notification settings - Fork 5
Check for a APT Release file in the github workflow: #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -187,7 +187,13 @@ jobs: | |||||||||||
cd .. | ||||||||||||
OUT=$(diff -rq compare debs || true) | ||||||||||||
mkdir -p status | ||||||||||||
if [[ -z "${OUT}" ]]; then | ||||||||||||
# Check for at least one Release file | ||||||||||||
RELEASE_FOUND=$(find compare/dists -type f -name Release | wc -l) | ||||||||||||
if [[ "$RELEASE_FOUND" -eq 0 ]]; then | ||||||||||||
echo "no_release" >> status/${SERVER_ID} | ||||||||||||
echo "${SERVER_URL}" >> status/${SERVER_ID} | ||||||||||||
echo "STATUS=no_release" >> $GITHUB_ENV | ||||||||||||
elif [[ -z "${OUT}" ]]; then | ||||||||||||
echo "true" >> status/${SERVER_ID} | ||||||||||||
echo "STATUS=true" >> $GITHUB_ENV | ||||||||||||
elif [[ "${exit_status}" -eq 0 ]]; then | ||||||||||||
|
@@ -246,7 +252,13 @@ jobs: | |||||||||||
cd .. | ||||||||||||
OUT=$(diff -rq compare debs || true) | ||||||||||||
mkdir -p status | ||||||||||||
if [[ -z "${OUT}" ]]; then | ||||||||||||
# Check for at least one Release file | ||||||||||||
RELEASE_FOUND=$(find compare/dists -type f -name Release | wc -l) | ||||||||||||
if [[ "$RELEASE_FOUND" -eq 0 ]]; then | ||||||||||||
echo "no_release" >> status/${SERVER_ID} | ||||||||||||
echo "${SERVER_URL}" >> status/${SERVER_ID} | ||||||||||||
echo "STATUS=no_release" >> $GITHUB_ENV | ||||||||||||
elif [[ -z "${OUT}" ]]; then | ||||||||||||
echo "true" >> status/${SERVER_ID} | ||||||||||||
echo "STATUS=true" >> $GITHUB_ENV | ||||||||||||
elif [[ "${exit_status}" -eq 0 ]]; then | ||||||||||||
|
@@ -412,6 +424,8 @@ jobs: | |||||||||||
echo "# Timeouts" >> $GITHUB_STEP_SUMMARY | ||||||||||||
grep timeout status/* | cut -d":" -f1 | xargs awk 'FNR==2{print}' >> $GITHUB_STEP_SUMMARY | ||||||||||||
#echo "$(grep timeout status/* | cut -d":" -f1 | cut -d"/" -f2 | sed ':a; N; s/\n/ /; ta') " >> $GITHUB_STEP_SUMMARY | ||||||||||||
echo "# No Release file" >> $GITHUB_STEP_SUMMARY | ||||||||||||
grep no_release status/* | cut -d":" -f1 | xargs awk 'FNR==2{print}' >> $GITHUB_STEP_SUMMARY | ||||||||||||
|
||||||||||||
Comment on lines
+427
to
429
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion
If no mirror is missing a Release file -grep no_release status/* | cut -d":" -f1 | xargs awk 'FNR==2{print}' >> $GITHUB_STEP_SUMMARY
+grep -q no_release status/* 2>/dev/null && \
+ grep no_release status/* | cut -d":" -f1 | xargs awk 'FNR==2{print}' >> $GITHUB_STEP_SUMMARY || true Repeat for the three other summary blocks (lines 461-463, 494-496, 528-530). 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||
echo "failoverserver=$(grep true status/* | cut -d":" -f1 | cut -d"/" -f2 | sed ':a; N; s/\n/ /; ta') " >> $GITHUB_ENV | ||||||||||||
echo "reloadKey=$(openssl rand -hex 16)" >> $GITHUB_ENV | ||||||||||||
|
@@ -444,6 +458,9 @@ jobs: | |||||||||||
echo "# Timeouts" >> $GITHUB_STEP_SUMMARY | ||||||||||||
grep timeout status/* | cut -d":" -f1 | xargs awk 'FNR==2{print}' >> $GITHUB_STEP_SUMMARY | ||||||||||||
#echo "$(grep timeout status/* | cut -d":" -f1 | cut -d"/" -f2 | sed ':a; N; s/\n/ /; ta') " >> $GITHUB_STEP_SUMMARY | ||||||||||||
echo "# No Release file" >> $GITHUB_STEP_SUMMARY | ||||||||||||
grep no_release status/* | cut -d":" -f1 | xargs awk 'FNR==2{print}' >> $GITHUB_STEP_SUMMARY | ||||||||||||
|
||||||||||||
echo "failoverserver=$(grep true status/* | cut -d":" -f1 | cut -d"/" -f2 | sed ':a; N; s/\n/ /; ta') " >> $GITHUB_ENV | ||||||||||||
echo "reloadKey=$(openssl rand -hex 16)" >> $GITHUB_ENV | ||||||||||||
rm -rf status | ||||||||||||
|
@@ -474,6 +491,8 @@ jobs: | |||||||||||
echo "# Timeouts" >> $GITHUB_STEP_SUMMARY | ||||||||||||
grep timeout status/* | cut -d":" -f1 | xargs awk 'FNR==2{print}' >> $GITHUB_STEP_SUMMARY | ||||||||||||
#echo "$(grep timeout status/* | cut -d":" -f1 | cut -d"/" -f2 | sed ':a; N; s/\n/ /; ta') " >> $GITHUB_STEP_SUMMARY | ||||||||||||
echo "# No Release file" >> $GITHUB_STEP_SUMMARY | ||||||||||||
grep no_release status/* | cut -d":" -f1 | xargs awk 'FNR==2{print}' >> $GITHUB_STEP_SUMMARY | ||||||||||||
|
||||||||||||
echo "failoverserver=$(grep true status/* | cut -d":" -f1 | cut -d"/" -f2 | sed ':a; N; s/\n/ /; ta') " >> $GITHUB_ENV | ||||||||||||
echo "reloadKey=$(openssl rand -hex 16)" >> $GITHUB_ENV | ||||||||||||
|
@@ -506,6 +525,8 @@ jobs: | |||||||||||
echo "# Timeouts" >> $GITHUB_STEP_SUMMARY | ||||||||||||
grep timeout status/* | cut -d":" -f1 | xargs awk 'FNR==2{print}' >> $GITHUB_STEP_SUMMARY | ||||||||||||
#echo "$(grep timeout status/* | cut -d":" -f1 | cut -d"/" -f2 | sed ':a; N; s/\n/ /; ta') " >> $GITHUB_STEP_SUMMARY | ||||||||||||
echo "# No Release file" >> $GITHUB_STEP_SUMMARY | ||||||||||||
grep no_release status/* | cut -d":" -f1 | xargs awk 'FNR==2{print}' >> $GITHUB_STEP_SUMMARY | ||||||||||||
|
||||||||||||
echo "failoverserver=$(grep true status/* | cut -d":" -f1 | cut -d"/" -f2 | sed ':a; N; s/\n/ /; ta') " >> $GITHUB_ENV | ||||||||||||
echo "reloadKey=$(openssl rand -hex 16)" >> $GITHUB_ENV | ||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exit_status
is never initialised &find
can break ‑ leads to false classificationsexit_status
is referenced later in the samecase
clause, but it is never set in this job (thelftp
call is followed by|| true
, discarding its exit code). Every server that reaches this branch will therefore evaluate[[ "${exit_status}" -eq 0 ]]
as[[ -eq 0 ]]
(empty → 0) and be markednot_in_sync
even when the mirror is fine.find compare/dists …
errors out (status = 1) whencompare/dists
does not exist (e.g. 404/timeout). Withset -e -o pipefail
(GitHub Actions default) that will abort the step.And preserve the
lftp
exit code:Finally guard the comparison:
Apply the same fixes to every identical block below.
🤖 Prompt for AI Agents