Skip to content

Commit

Permalink
fix date check
Browse files Browse the repository at this point in the history
  • Loading branch information
drmowinckels committed Nov 7, 2024
1 parent 4249c81 commit 1c9439c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ jobs:
latest_post=$(find "${BLOG_PATH}" | grep /index.md$ | grep -v "XX-XX" | sort | tail -n1)
echo "POST=${latest_post}" >> $GITHUB_OUTPUT
- name: Check post date
id: check-date
run: |
post_date=$(grep "^date:" "${{ steps.check-post.outputs.POST}}" | sed 's/^date: //' | sed 's/["'\'']//g')
post_date=$(grep "^date:" "${{ steps.check-post.outputs.POST }}" | sed 's/^date: //' | sed 's/["'\'']//g')
echo "POST_DATE=${post_date}" >> $GITHUB_OUTPUT
one_day_ago=$(date -d "-1 days" +%Y-%m-%d)
echo ${{ steps.check-post.outputs.POST }} ${post_date} ${one_day_ago}
echo "ANNOUNCE=false" >> $GITHUB_OUTPUT
if (( ${post_date} > ${one_day_ago} )); then
echo "ANNOUNCE=true" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit 1c9439c

Please sign in to comment.