Skip to content

Commit d6f9db4

Browse files
committed
Turn off error if no stale previews found in DocPreviewCleanup.yml
Instead of `error`-ing, set an environment variable that determines if the next step should be run. Lack of stale PR previews is not a failure condition, just an early termination one.
1 parent 80f5200 commit d6f9db4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

.github/workflows/DocPreviewCleanup.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,18 @@ jobs:
6262
6363
if isempty(stale_previews)
6464
@info "No stale previews"
65-
exit(1)
65+
println(ENV["GITHUB_ENV"], "FOUND_STALE_PREVIEWS=false")
66+
exit()
6667
end
68+
println(ENV["GITHUB_ENV"], "FOUND_STALE_PREVIEWS=true")
6769
6870
for pr in stale_previews
6971
path = joinpath("previews", "PR$pr")
7072
@info "Removing $path"
7173
run(`git rm -rf $path`)
7274
end
7375
- name: Push changes
76+
if: ${{ env.FOUND_STALE_PREVIEWS == 'true' }}
7477
run: |
7578
git config user.name "Documenter.jl"
7679
git config user.email "[email protected]"

0 commit comments

Comments
 (0)