diff options
author | Badlop <badlop@process-one.net> | 2022-07-27 12:40:07 +0200 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2022-07-27 15:16:51 +0200 |
commit | bc8050eb03453b4c1b221394a95ec0aac406f803 (patch) | |
tree | d79a7257c620237748b152adfa9e222d3d63abc5 /src | |
parent | Handle not found COMMIT.json, for example in GH Actions (diff) |
Don't bother with COMMIT.json user-friendly feature in automated user case
Diffstat (limited to 'src')
-rw-r--r-- | src/ext_mod.erl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ext_mod.erl b/src/ext_mod.erl index df2d0c676..7058cd7ac 100644 --- a/src/ext_mod.erl +++ b/src/ext_mod.erl @@ -391,7 +391,7 @@ extract_github_master(Repos, DestDir) -> ok -> RepDir = filename:join(DestDir, module_name(Repos)), file:rename(RepDir++"-master", RepDir), - write_commit_json(Url, RepDir); + maybe_write_commit_json(Url, RepDir); Error -> Error end. @@ -736,6 +736,14 @@ format({Key, Val}) -> % TODO: improve Yaml parsing %% -- COMMIT.json +maybe_write_commit_json(Url, RepDir) -> + case (os:getenv("GITHUB_ACTIONS") == "true") of + true -> + ok; + false -> + write_commit_json(Url, RepDir) + end. + write_commit_json(Url, RepDir) -> Url2 = string_replace(Url, "https://github.com", "https://api.github.com/repos"), BranchUrl = lists:flatten(Url2 ++ "/branches/master"), |