Skip to content

Commit

Permalink
update state preview removal
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasIsensee committed Sep 4, 2024
1 parent a8a60e4 commit e21fc87
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/stale_preview_removal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Doc Preview Cleanup

on:
schedule:
- cron: "0 0 * * *"
- cron: "0 * * * *"

jobs:
doc-preview-cleanup:
Expand All @@ -17,8 +17,8 @@ jobs:
shell: julia {0}
run: |
using Pkg
pkg"activate --temp"
pkg"add HTTP JSON3"
Pkg.activate(; temp=true)
Pkg.add(["HTTP", "JSON3"])
using HTTP
using JSON3
Expand All @@ -43,8 +43,7 @@ jobs:
end
return prs
end
prs = all_prs()
open_within_threshold = map(x -> x.number, filter(prs) do pr
open_within_threshold = map(x -> x.number, filter(all_prs()) do pr
time = DateTime(pr.updated_at[1:19], ISODateTimeFormat)
return pr.state == "open" && Dates.days(now() - time) <= retention_days
end)
Expand All @@ -54,7 +53,7 @@ jobs:
if isempty(stale_previews)
@info "No stale previews"
exit(1)
exit(0)
end
for pr in stale_previews
Expand Down

0 comments on commit e21fc87

Please sign in to comment.