Fix timezone mismatch in version bump PR filter and use dynamic canvas URL

The date comparison used git's author date in its stored timezone
(e.g. -04:00) against GitHub API mergedAt values in UTC (Z suffix).
Lexicographic string comparison across different timezone formats
caused every PR from the tagged commit's day to be re-included in
subsequent versions. Normalize to UTC with format-local so both
sides match.

Also replace the hardcoded canvas URL with the CANVAS_ID env var
already available in the step.
This commit is contained in:
Adam Moussa 2026-05-04 15:26:36 -04:00
parent 5bc5cc9131
commit fbabab9692

View file

@ -58,7 +58,7 @@ jobs:
exit 0
fi
LAST_TAG_DATE=$(git log -1 --format=%aI "$LAST_TAG")
LAST_TAG_DATE=$(TZ=UTC git log -1 --date=format-local:'%Y-%m-%dT%H:%M:%SZ' --format='%ad' "$LAST_TAG")
PRS=$(gh pr list --state merged --json number,title,mergedAt \
--jq "sort_by(.number) | .[] | select(.mergedAt > \"$LAST_TAG_DATE\")")
@ -158,7 +158,7 @@ jobs:
VERSION: ${{ steps.changes.outputs.version }}
SLACK_BULLETS: ${{ steps.changes.outputs.slack_bullets }}
run: |
CANVAS_URL="https://app.slack.com/docs/F0B13V3EBUN"
CANVAS_URL="https://app.slack.com/docs/${CANVAS_ID}"
read -r -d '' TEXT <<ENDTXT || true
*After-Hours Scheduler has been updated to ${VERSION}*