We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2578c69 commit 3413b0cCopy full SHA for 3413b0c
1 file changed
.github/workflows/paint.yml
@@ -43,12 +43,13 @@ jobs:
43
STATE=$(cat data/state.json)
44
45
USER_COOLDOWN=$(echo $STATE | jq -r ".users[\"$USERNAME\"] // 0")
46
- TILE_LOCK=$(echo $STATE | jq -r ".tiles[\"$COORD\"].lock_until // 0")
+ TILE_LOCK=$(echo "$STATE" | jq -r ".tiles[\"$COORD\"]?.lock_until // 0")
47
48
# Check user cooldown
49
if [ "$NOW" -lt "$USER_COOLDOWN" ]; then
50
- REMAIN=$(( ($USER_COOLDOWN - $NOW) / 3600 ))
51
- gh issue comment $ISSUE_NUMBER --body "⏳ You may paint again in ${REMAIN}h."
+ SECONDS_LEFT=$((USER_COOLDOWN - NOW))
+ HOURS_LEFT=$(( (SECONDS_LEFT + 3599) / 3600 ))
52
+ gh issue comment $ISSUE_NUMBER --body "⏳ You may paint again in approximately ${HOURS_LEFT}h."
53
exit 0
54
fi
55
0 commit comments