Reference
MassApplyPatch.add_compat_entries! — Method
add_compat_entries!(project_toml; include_weakdeps=true, include_julia=nothing)Add missing [compat] entries in a Project.toml file. Existing [compat] entries are preserved as-is.
Missing entries are computed as:
- package names in
[deps](and optionally[weakdeps]) - minus existing package names in
[compat]
By default, julia compat is added only for package projects (those with both name and uuid fields). For sub-environments like test/docs/examples, julia compat is skipped unless include_julia=true is passed explicitly.
MassApplyPatch.allow_automerge! — Function
allow_automerge!(repos, enable::Bool = true; token=ENV["GITHUB_TOKEN"], api=GitHub.DEFAULT_API)Enable or disable the repository-level "Allow auto-merge" setting for each "OWNER/REPO" in repos, for example allow_automerge!(["ITensor/SparseArraysBase.jl"], true) to enable it or allow_automerge!(["ITensor/SparseArraysBase.jl"], false) to disable it.
Returns: Dict("OWNER/REPO" => (ok::Bool, status::Int, message::String))
MassApplyPatch.close_issue! — Method
close_issue!(issue; delete_branch=false, comment=nothing, ignore_errors=true)Close a GitHub issue or pull request using the gh CLI.
issue may be an issue/PR URL like:
https://github.com/ORG/REPO/issues/123https://github.com/ORG/REPO/pull/123or any identifier accepted bygh issue close/gh pr close.
If issue points to a PR and delete_branch=true, the PR branch is deleted after close. If comment is provided, posts a comment after closing. Returns true if the close command succeeded, false otherwise (unless ignore_errors=false).
Requires: gh installed and authenticated (gh auth login).
MassApplyPatch.close_issues! — Method
close_issues!(issues; kwargs...)Close multiple GitHub issues/PRs. Returns a Vector{Bool} of close results.
MassApplyPatch.close_pr! — Method
close_pr!(pr; delete_branch=false, comment=nothing, ignore_errors=true)Backward-compatible wrapper for closing a pull request. Uses close_issue!.
MassApplyPatch.close_prs! — Method
close_prs!(prs; kwargs...)Backward-compatible wrapper for closing multiple pull requests. Uses close_issues!.
MassApplyPatch.create_issues! — Method
create_issues!(
repos::AbstractVector{<:AbstractString};
title::AbstractString,
body::AbstractString = "",
labels::AbstractVector{<:AbstractString} = String[],
pin::Bool = false
)Create a new issue with the given title and body in each repository of repos (format: "OWNER/REPO"). Returns a Vector of named tuples (; url) with the URL of each created issue. If pin=true, the issue is pinned after creation.
MassApplyPatch.delete_branches! — Method
delete_branches!(f, repos; ignore_errors=true, api=GitHub.DEFAULT_API)Delete branches in each repository from repos when f(branch_name) is true.
repos should contain entries like "OWNER/REPO".
Returns a vector of named tuples: (repo, branch, ok, status, message).
MassApplyPatch.disable_automerges! — Method
disable_automerges!(pr_urls::AbstractVector{<:AbstractString})Disable auto-merge for the given PR URLs via gh pr merge --disable-auto.
MassApplyPatch.filter_open_issues — Method
filter_open_issues(
repos::AbstractVector{<:AbstractString}, predicate::Function;
sort="updated", direction="desc"
)Return a flattened Vector of open issues from all repos that satisfy predicate. predicate should accept a named tuple (url, title, body).
MassApplyPatch.main — Method
MassApplyPatch.main(argv)Command line interface for MassApplyPatch.
Arguments:
argv: Command line arguments. Expected format: massapplypatch <org/repo>... –patch=<patchname>... [–notrigger-patch=<patchname>...] [–branch=branchname] [–title=prtitle] [–body=prbody]
The patch function should be provided as a Julia file, which is included and must define a function patch(repo_path).
MassApplyPatch.merge_prs! — Method
merge_prs!(pr_urls::AbstractVector{<:AbstractString}; kwargs...)Merge PRs via gh pr merge.
Keyword arguments:
force::Bool=false: bypass requirements and merge immediately (falseis equivalent to--auto,trueis equivalent to--admin).merge_method::AbstractString="squash": merge strategy, one of "merge", "squash", or "rebase".commit_title::Union{Nothing, String}=nothing: custom commit title (equivalent to--subject).commit_message::Union{Nothing, String}=nothing: custom commit message (equivalent to--body).
MassApplyPatch.open_issues — Method
open_issues(repos::AbstractVector{<:AbstractString}; sort="updated", direction="desc")Return a Vector of named tuples (url, title, body) (all String) for all open issues in each repository of repos (format: "OWNER/REPO"), sorted by most recently updated first. Pull requests are excluded.
MassApplyPatch.open_prs — Method
open_prs(repos::AbstractVector{<:AbstractString}; sort="updated", direction="desc")Return a Vector of named tuples (url, branch, title, body) (all String) for all open PRs in each repository of repos (format: "OWNER/REPO"), sorted by most recently updated first.
MassApplyPatch.pr_statuses — Method
pr_statuses(prs::AbstractVector{<:AbstractString})Return a Vector{String} of PR statuses in the same order as prs.
Accepted PR formats:
"https://github.com/OWNER/REPO/pull/123""OWNER/REPO#123"
Statuses are "draft" (when draft), otherwise "open" or "closed".
Requires: gh installed and authenticated (gh auth login).
MassApplyPatch.protect_branch! — Method
protect_branch!(repos;
checks::Vector{String},
branch::Union{Nothing,String}=nothing,
api::GitHub.GitHubAPI=GitHub.DEFAULT_API,
strict::Bool=true,
enforce_admins::Bool=false,
require_pr::Bool=true,
required_approvals::Int=1,
require_code_owner_reviews::Bool=false,
dismiss_stale_reviews::Bool=true,
require_linear_history::Bool=true,
allow_force_pushes::Bool=false,
allow_deletions::Bool=false,
) -> Dict{String,Tuple{Bool,Int,String}}Apply branch protection to each repo in repos.
checksare the required status check contexts (exact names).branch=nothingmeans “use each repo's default branch”.
MassApplyPatch.reopen_issue! — Method
reopen_issue!(issue; comment=nothing, ignore_errors=true)Reopen a GitHub issue or pull request using the gh CLI.
issue may be an issue/PR URL like:
https://github.com/ORG/REPO/issues/123https://github.com/ORG/REPO/pull/123or any identifier accepted bygh issue reopen/gh pr reopen.
If comment is provided, posts a comment after reopening. Returns true if the reopen command succeeded, false otherwise (unless ignore_errors=false).
Requires: gh installed and authenticated (gh auth login).
MassApplyPatch.reopen_issues! — Method
reopen_issues!(issues; kwargs...)Reopen multiple GitHub issues/PRs. Returns a Vector{Bool} of reopen results.
MassApplyPatch.trigger_workflow_dispatch! — Method
trigger_workflow_dispatch!(
repos::AbstractVector{<:AbstractString},
workflow::AbstractString;
ref::Union{Nothing, AbstractString}=nothing,
inputs::AbstractDict=Dict{String, String}(),
api::GitHub.GitHubAPI=GitHub.DEFAULT_API,
)Trigger a GitHub Actions workflow dispatch for each repository in repos.
reposshould contain entries like"OWNER/REPO".workflowcan be a workflow file name (for example"TagBot.yml"), workflow name, or workflow ID.- If
refisnothing, each repository's default branch is used. inputsare optionalworkflow_dispatchinputs.
Returns:
Dict("OWNER/REPO" => (ok::Bool, status::Int, message::String, ref::String))