forked from travelping/eradius
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrebar.config.script
30 lines (28 loc) · 1013 Bytes
/
rebar.config.script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
%% -*- erlang -*-
ExistingErlOpts = proplists:get_value(erl_opts, CONFIG, []),
CONFIG1 =
try
persistent_term:info(),
io:format("CONFIG: enabling persistent_term support~n"),
lists:keyreplace(erl_opts, 1, CONFIG,
{erl_opts, [{d, 'HAVE_PERSISTENT_TERM'}|ExistingErlOpts]})
catch
_:_ ->
CONFIG
end,
case {os:getenv("GITHUB_ACTIONS"), os:getenv("GITHUB_TOKEN")} of
{"true", Token} when is_list(Token) ->
CONFIG2 = [{coveralls_repo_token, Token},
{coveralls_service_job_id, os:getenv("GITHUB_RUN_ID")},
{coveralls_commit_sha, os:getenv("GITHUB_SHA")},
{coveralls_flag_name, os:getenv("COVERALLS_FLAG_NAME")} | CONFIG1],
case os:getenv("GITHUB_EVENT_NAME") =:= "pull_request"
andalso string:tokens(os:getenv("GITHUB_REF"), "/") of
[_, "pull", PRNO, _] ->
[{coveralls_service_pull_request, PRNO} | CONFIG2];
_ ->
CONFIG2
end;
_ ->
CONFIG1
end.