Skip to content

Commit

Permalink
ci: limit S3 recovery to 7 days in the past
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenruizdegauna committed Jan 22, 2025
1 parent ccab1a7 commit 4cf695d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/recover_s3_repository.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ jobs:
fi
echo "datetime is not in the future"
echo "Validating that datetime is max 7 days in the past"
python3 -c "from datetime import datetime, timezone, timedelta; import sys; sys.exit(0) if datetime.strptime('$datetime', '%m-%d-%Y %H:%M:%S %z') >= datetime.now(timezone.utc) - timedelta(days=7) else sys.exit(1)"
exit_code=$?
if [ $exit_code -ne 0 ]; then
exit 1
fi
echo "datetime cannot be more than 7 days in the past"
echo "DATE_TIME=$datetime" >> $GITHUB_ENV
- name: Validate path input does not have leading nor trailing slash
Expand Down

0 comments on commit 4cf695d

Please sign in to comment.