Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide default to get_fields #19

Merged
merged 5 commits into from
Nov 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ runs:
d$set_list(key, new_values)
}
desc_field_clear_if_empty <- function(d, key) {
if (d$has_fields(key) && d$get_field(key) == "") {
if (d$has_fields(key) && d$get_field(key, "") == "") {
pawelru marked this conversation as resolved.
Show resolved Hide resolved
d$del(key)
}
}
Expand Down Expand Up @@ -394,16 +394,16 @@ runs:
}

# skip if already there
if (pkg_ref$ref %in% d$get_field("Config/Needs/DepsDev")) {
if (pkg_ref$ref %in% d$get_field("Config/Needs/DepsDev", ""))) {
llrs-roche marked this conversation as resolved.
Show resolved Hide resolved
cli::cli_alert_info("Reference for package {.pkg {pkg}} already exists in the {.field Config/Needs/DepsDev} field. Skipping.")
next()
}

# skip if already in `DepsBranch`
# this is to avoid duplicates - `Deps Branch` takes precedence over `DepsDev`
if (
(!identical(d$get_field("Config/Needs/DepsBranch"), "")) &&
(pkg %in% vapply(d$get_field("Config/Needs/DepsBranch"), function(x) pkgdepends::parse_pkg_ref(x)$package, character(1)))
(!identical(d$get_field("Config/Needs/DepsBranch", ""), "")) &&
(pkg %in% vapply(d$get_field("Config/Needs/DepsBranch", ""), function(x) pkgdepends::parse_pkg_ref(x)$package, character(1)))
llrs-roche marked this conversation as resolved.
Show resolved Hide resolved
) {
cli::cli_alert_info("A reference for package {.pkg {pkg}} already exists in the {.field Config/Needs/DepsBranch} field. Skipping.")
next()
Expand Down
Loading