mirror of
https://github.com/julia-actions/julia-runtest.git
synced 2026-02-11 18:46:55 +08:00
26 lines
718 B
Julia
26 lines
718 B
Julia
module AutodetectDependabot
|
|
|
|
function _get_possible_branch_names()
|
|
possible_branch_names = [
|
|
get(ENV, "GITHUB_BASE_REF", ""),
|
|
get(ENV, "GITHUB_HEAD_REF", ""),
|
|
get(ENV, "GITHUB_REF", ""),
|
|
]
|
|
return possible_branch_names
|
|
end
|
|
|
|
function _chop_refs_head(branch_name::AbstractString)
|
|
replace(branch_name, r"^(refs\/heads\/)" => "")
|
|
end
|
|
|
|
function _is_dependabot_branch(branch_name::AbstractString)
|
|
return startswith(branch_name, "dependabot/julia") || startswith(branch_name, "compathelper/")
|
|
end
|
|
|
|
function is_dependabot_job()
|
|
possible_branch_names = _get_possible_branch_names()
|
|
return any(_is_dependabot_branch.(_chop_refs_head.(possible_branch_names)))
|
|
end
|
|
|
|
end # module
|