Skip to content

Commit 9c931ed

Browse files
authored
Ping the Yggdrasil committer when deploying (#1057)
1 parent aaa8966 commit 9c931ed

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

src/AutoBuild.jl

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,9 +517,16 @@ function register_jll(name, build_version, dependencies, julia_compat;
517517
* Commit: $(wrapper_commit_hash)
518518
"""
519519
if is_yggdrasil()
520+
commit_hash = yggdrasil_head()
520521
body *= """
521-
* Revision on Yggdrasil: https://github.com/JuliaPackaging/Yggdrasil/commit/$(yggdrasil_head())
522+
* Revision on Yggdrasil: https://github.com/JuliaPackaging/Yggdrasil/commit/$commit_hash
522523
"""
524+
commit_author_login = get_github_author_login("JuliaPackaging/Yggdrasil", commit_hash; gh_auth=gh_auth)
525+
if commit_author_login !== nothing
526+
body *= """
527+
* Created by: @$commit_author_login
528+
"""
529+
end
523530
end
524531
params = Dict(
525532
"base" => "master",
@@ -885,6 +892,15 @@ function download_github_release(download_dir, repo, tag; gh_auth=Wizard.github_
885892
return assets
886893
end
887894

895+
function get_github_author_login(repository, commit_hash; gh_auth=Wizard.github_auth())
896+
try
897+
commit = GitHub.commit(repository, commit_hash; auth=gh_auth)
898+
commit.author.login
899+
catch
900+
nothing
901+
end
902+
end
903+
888904

889905
function init_jll_package(name, code_dir, deploy_repo;
890906
gh_auth = Wizard.github_auth(;allow_anonymous=false),

test/jll.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using JSON
22
using UUIDs
3-
using BinaryBuilder: jll_uuid, build_project_dict
3+
using GitHub
4+
using BinaryBuilder: jll_uuid, build_project_dict, get_github_author_login, Wizard
45

56
module TestJLL end
67

@@ -21,6 +22,13 @@ module TestJLL end
2122
@test project["version"] == "1.3.5"
2223
# Make sure BuildDependency's don't find their way to the project
2324
@test_throws MethodError build_project_dict("LibFoo", v"1.3.5", [Dependency("Zlib_jll"), BuildDependency("Xorg_util_macros_jll")])
25+
26+
gh_auth = Wizard.github_auth(;allow_anonymous=true)
27+
@test get_github_author_login("JuliaPackaging/Yggdrasil", "invalid_hash"; gh_auth) === nothing
28+
@test get_github_author_login("JuliaPackaging/Yggdrasil", "815de56a4440f4e05333c5295d74f1dc9b73ebe3"; gh_auth) === nothing
29+
if gh_auth != GitHub.AnonymousAuth()
30+
@test get_github_author_login("JuliaPackaging/Yggdrasil", "dea7c3fadad16281ead2427f7ab9b32f1c8cb664"; gh_auth) === "Pangoraw"
31+
end
2432
end
2533

2634
@testset "JLLs - building" begin

0 commit comments

Comments
 (0)