Skip to content

Allow object jobs in the "checks" configuration array #14

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

Merged

Conversation

weierophinney
Copy link
Member

This patch expands the functionality of the "checks.[].job" element to allow specifying it as an object. When so discovered, the action will now serialize it to JSON.

It also now performs validations and normalization on each "checks" element and each "job" to ensure they are well-formed; if not, a warning will be raised by the action, and the check will be omitted.

core.warning is not the same as console.log, and needs a single string.
Concatenate message with JSON.stringify() of second and later arguments.

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
Adds functionality to validate checks found in the "checks" array, including the ability to validate and normalize the "job" element.
If the "job" element is a string, it attempts to parse it, raising a warning if the job is unparseable, and excluding it from the list of checks returned.
If the "job" is parseable and/or an object, it then validates that a valid PHP version is present, a valid "dependencies" set is specified, and that a command is present and a string.
If valid, the job is serialized to JSON and the value reassigned in the check.

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
@weierophinney weierophinney added this to the 1.3.0 milestone Mar 4, 2021
@weierophinney weierophinney merged commit fde2c44 into laminas:1.3.x Mar 4, 2021
@weierophinney weierophinney deleted the feature/allow-object-jobs-in-checks branch March 4, 2021 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide ability to specify jobs defined in checks configuration as objects
1 participant