Add the force_latest_compatible_version input, and add the "auto-detect Dependabot/CompatHelper" functionality (#20)

Co-authored-by: Sascha Mann <git@mail.saschamann.eu>
This commit is contained in:
Dilum Aluthge
2021-03-31 17:56:56 -04:00
committed by GitHub
parent 07b45fecd2
commit eda4346d69
4 changed files with 60 additions and 2 deletions

25
autodetect-dependabot.jl Normal file
View File

@@ -0,0 +1,25 @@
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