Skip to content

Commit

Permalink
Fix: several fixes in workflow to create a summary (#20)
Browse files Browse the repository at this point in the history
- 1 != 01
- Use of undefined variable
  • Loading branch information
TrueBrain authored Jan 8, 2024
1 parent 301fd3c commit aedd22a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/create-summary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,24 @@ jobs:
start_date=$(date -d "${first_monday} +${week} weeks -1 week" +%Y-%m-%d)
end_date=$(date -d "${start_date} +6 days" +%Y-%m-%d)
if [ "${week}" -lt 10 ]; then
week="0${week}"
fi
# Ensure the start date is actually in the week we want.
start_check=$(date -d "${start_date}" +%G-%V)
if [ "${start_check}" != "${year}-${week}" ]; then
echo "Start date ${start_date} is not in week ${week} of ${year}, but in ${start_check}"
echo "Start date ${start_date} is not in ${year}-${week}, but in ${start_check}"
exit 1
fi
# Ensure the end date is actually in the week we want.
end_check=$(date -d "${end_date}" +%G-%V)
if [ "${end_check}" != "${year}-${week}" ]; then
echo "End date ${end_date} is not in week ${week} of ${year}, but in ${end_check}"
echo "End date ${end_date} is not in ${year}-${week}, but in ${end_check}"
exit 1
fi
if [ "${week}" -lt 10 ]; then
week="0${week}"
fi
echo "Week: ${week}"
echo "Year: ${year}"
echo "Start date: ${start_date}"
Expand All @@ -94,9 +94,9 @@ jobs:
mkdir -p packed
for i in $(seq 0 6); do
date=$(date -d "${start_date} +${i} days" +%Y-%m-%d)
date_year=$(date -d "${start_date} +${i} days" +%Y)
date_month=$(date -d "${start_date} +${i} days" +%m)
date=$(date -d "${{ steps.dates.outputs.start_date }} +${i} days" +%Y-%m-%d)
date_year=$(date -d "${{ steps.dates.outputs.start_date }} +${i} days" +%Y)
date_month=$(date -d "${{ steps.dates.outputs.start_date }} +${i} days" +%m)
echo "Downloading ${date}"
rclone copy -v openttd:survey-packed-prod/${date_year}/${date_month}/openttd-survey-pack.${date}.tar.xz packed
Expand Down

0 comments on commit aedd22a

Please sign in to comment.