Skip to content

Commit

Permalink
Merge branch 'lukas/gh/prune-large-files-pr-to-10GB-limit'
Browse files Browse the repository at this point in the history
* lukas/gh/prune-large-files-pr-to-10GB-limit:
  gh: Fix syntax error in pr sync code
  • Loading branch information
garazdawi committed Jun 5, 2023
2 parents 09baa41 + f744018 commit adfb87f
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions .github/scripts/sync-github-prs.es
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ main([Repo, Target]) ->
end
end, AllPrs),

purge_prs(Target).

purge_prs(Target);

main([Repo, Target, PRNo]) ->
handle_prs(Repo, Target, [ghapi("gh api /repos/"++Repo++"/pulls/"++PRNo)]).
Expand Down Expand Up @@ -165,12 +164,7 @@ purge_prs(Target) ->
Files = string:split(cmd("find prs -type f -exec du -a {} \+"),"\n",all),
SortedFiles =
lists:sort(fun([A|_]=As,[B|_]=Bs) ->
try
binary_to_integer(A) >= binary_to_integer(B)
catch E:R ->
io:format("~p ~p",[As, Bs]),
false
end
end, [string:split(F,"\t") || F <- Files, F =/= <<>>]),
purge_prs(SortedFiles, Target, get_directory_size(Target)).
purge_prs(Files, Target, Size) when Size > 10_000_000_000 ->
Expand Down

0 comments on commit adfb87f

Please sign in to comment.