diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..f4cb059 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,1149 @@ +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +max_line_length = 120 +tab_width = 4 +ij_continuation_indent_size = 4 +ij_formatter_off_tag = @formatter:off +ij_formatter_on_tag = @formatter:on +ij_formatter_tags_enabled = false +ij_smart_tabs = false +ij_visual_guides = none +ij_wrap_on_typing = false + +[*.css] +ij_css_align_closing_brace_with_properties = false +ij_css_blank_lines_around_nested_selector = 1 +ij_css_blank_lines_between_blocks = 1 +ij_css_block_comment_add_space = false +ij_css_brace_placement = end_of_line +ij_css_enforce_quotes_on_format = false +ij_css_hex_color_long_format = false +ij_css_hex_color_lower_case = false +ij_css_hex_color_short_format = false +ij_css_hex_color_upper_case = false +ij_css_keep_blank_lines_in_code = 2 +ij_css_keep_indents_on_empty_lines = false +ij_css_keep_single_line_blocks = false +ij_css_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow +ij_css_space_after_colon = true +ij_css_space_before_opening_brace = true +ij_css_use_double_quotes = true +ij_css_value_alignment = do_not_align + +[*.java] +ij_java_align_consecutive_assignments = false +ij_java_align_consecutive_variable_declarations = false +ij_java_align_group_field_declarations = false +ij_java_align_multiline_annotation_parameters = false +ij_java_align_multiline_array_initializer_expression = false +ij_java_align_multiline_assignment = false +ij_java_align_multiline_binary_operation = false +ij_java_align_multiline_chained_methods = false +ij_java_align_multiline_extends_list = false +ij_java_align_multiline_for = true +ij_java_align_multiline_method_parentheses = false +ij_java_align_multiline_parameters = true +ij_java_align_multiline_parameters_in_calls = false +ij_java_align_multiline_parenthesized_expression = false +ij_java_align_multiline_records = true +ij_java_align_multiline_resources = true +ij_java_align_multiline_ternary_operation = false +ij_java_align_multiline_text_blocks = false +ij_java_align_multiline_throws_list = false +ij_java_align_subsequent_simple_methods = false +ij_java_align_throws_keyword = false +ij_java_align_types_in_multi_catch = true +ij_java_annotation_parameter_wrap = off +ij_java_array_initializer_new_line_after_left_brace = false +ij_java_array_initializer_right_brace_on_new_line = false +ij_java_array_initializer_wrap = off +ij_java_assert_statement_colon_on_next_line = false +ij_java_assert_statement_wrap = off +ij_java_assignment_wrap = off +ij_java_binary_operation_sign_on_next_line = false +ij_java_binary_operation_wrap = off +ij_java_blank_lines_after_anonymous_class_header = 0 +ij_java_blank_lines_after_class_header = 0 +ij_java_blank_lines_after_imports = 1 +ij_java_blank_lines_after_package = 1 +ij_java_blank_lines_around_class = 1 +ij_java_blank_lines_around_field = 0 +ij_java_blank_lines_around_field_in_interface = 0 +ij_java_blank_lines_around_initializer = 1 +ij_java_blank_lines_around_method = 1 +ij_java_blank_lines_around_method_in_interface = 1 +ij_java_blank_lines_before_class_end = 0 +ij_java_blank_lines_before_imports = 1 +ij_java_blank_lines_before_method_body = 0 +ij_java_blank_lines_before_package = 0 +ij_java_block_brace_style = end_of_line +ij_java_block_comment_add_space = false +ij_java_block_comment_at_first_column = true +ij_java_builder_methods = none +ij_java_call_parameters_new_line_after_left_paren = false +ij_java_call_parameters_right_paren_on_new_line = false +ij_java_call_parameters_wrap = off +ij_java_case_statement_on_separate_line = true +ij_java_catch_on_new_line = false +ij_java_class_annotation_wrap = split_into_lines +ij_java_class_brace_style = end_of_line +ij_java_class_count_to_use_import_on_demand = 5 +ij_java_class_names_in_javadoc = 1 +ij_java_do_not_indent_top_level_class_members = false +ij_java_do_not_wrap_after_single_annotation = false +ij_java_do_not_wrap_after_single_annotation_in_parameter = false +ij_java_do_while_brace_force = never +ij_java_doc_add_blank_line_after_description = true +ij_java_doc_add_blank_line_after_param_comments = false +ij_java_doc_add_blank_line_after_return = false +ij_java_doc_add_p_tag_on_empty_lines = true +ij_java_doc_align_exception_comments = true +ij_java_doc_align_param_comments = true +ij_java_doc_do_not_wrap_if_one_line = false +ij_java_doc_enable_formatting = true +ij_java_doc_enable_leading_asterisks = true +ij_java_doc_indent_on_continuation = false +ij_java_doc_keep_empty_lines = true +ij_java_doc_keep_empty_parameter_tag = true +ij_java_doc_keep_empty_return_tag = true +ij_java_doc_keep_empty_throws_tag = true +ij_java_doc_keep_invalid_tags = true +ij_java_doc_param_description_on_new_line = false +ij_java_doc_preserve_line_breaks = false +ij_java_doc_use_throws_not_exception_tag = true +ij_java_else_on_new_line = false +ij_java_entity_dd_suffix = EJB +ij_java_entity_eb_suffix = Bean +ij_java_entity_hi_suffix = Home +ij_java_entity_lhi_prefix = Local +ij_java_entity_lhi_suffix = Home +ij_java_entity_li_prefix = Local +ij_java_entity_pk_class = java.lang.String +ij_java_entity_vo_suffix = VO +ij_java_enum_constants_wrap = off +ij_java_extends_keyword_wrap = off +ij_java_extends_list_wrap = off +ij_java_field_annotation_wrap = split_into_lines +ij_java_finally_on_new_line = false +ij_java_for_brace_force = never +ij_java_for_statement_new_line_after_left_paren = false +ij_java_for_statement_right_paren_on_new_line = false +ij_java_for_statement_wrap = off +ij_java_generate_final_locals = false +ij_java_generate_final_parameters = true +ij_java_if_brace_force = never +ij_java_imports_layout = *,|,javax.**,java.**,|,$* +ij_java_indent_case_from_switch = true +ij_java_insert_inner_class_imports = false +ij_java_insert_override_annotation = true +ij_java_keep_blank_lines_before_right_brace = 2 +ij_java_keep_blank_lines_between_package_declaration_and_header = 2 +ij_java_keep_blank_lines_in_code = 2 +ij_java_keep_blank_lines_in_declarations = 2 +ij_java_keep_builder_methods_indents = false +ij_java_keep_control_statement_in_one_line = true +ij_java_keep_first_column_comment = true +ij_java_keep_indents_on_empty_lines = false +ij_java_keep_line_breaks = true +ij_java_keep_multiple_expressions_in_one_line = false +ij_java_keep_simple_blocks_in_one_line = false +ij_java_keep_simple_classes_in_one_line = false +ij_java_keep_simple_lambdas_in_one_line = false +ij_java_keep_simple_methods_in_one_line = false +ij_java_label_indent_absolute = false +ij_java_label_indent_size = 0 +ij_java_lambda_brace_style = end_of_line +ij_java_layout_static_imports_separately = true +ij_java_line_comment_add_space = false +ij_java_line_comment_add_space_on_reformat = false +ij_java_line_comment_at_first_column = true +ij_java_message_dd_suffix = EJB +ij_java_message_eb_suffix = Bean +ij_java_method_annotation_wrap = split_into_lines +ij_java_method_brace_style = end_of_line +ij_java_method_call_chain_wrap = off +ij_java_method_parameters_new_line_after_left_paren = false +ij_java_method_parameters_right_paren_on_new_line = false +ij_java_method_parameters_wrap = off +ij_java_modifier_list_wrap = false +ij_java_multi_catch_types_wrap = normal +ij_java_names_count_to_use_import_on_demand = 3 +ij_java_new_line_after_lparen_in_annotation = false +ij_java_new_line_after_lparen_in_record_header = false +ij_java_packages_to_use_import_on_demand = java.awt.*,javax.swing.* +ij_java_parameter_annotation_wrap = off +ij_java_parentheses_expression_new_line_after_left_paren = false +ij_java_parentheses_expression_right_paren_on_new_line = false +ij_java_place_assignment_sign_on_next_line = false +ij_java_prefer_longer_names = true +ij_java_prefer_parameters_wrap = false +ij_java_record_components_wrap = normal +ij_java_repeat_synchronized = true +ij_java_replace_instanceof_and_cast = false +ij_java_replace_null_check = true +ij_java_replace_sum_lambda_with_method_ref = true +ij_java_resource_list_new_line_after_left_paren = false +ij_java_resource_list_right_paren_on_new_line = false +ij_java_resource_list_wrap = off +ij_java_rparen_on_new_line_in_annotation = false +ij_java_rparen_on_new_line_in_record_header = false +ij_java_session_dd_suffix = EJB +ij_java_session_eb_suffix = Bean +ij_java_session_hi_suffix = Home +ij_java_session_lhi_prefix = Local +ij_java_session_lhi_suffix = Home +ij_java_session_li_prefix = Local +ij_java_session_si_suffix = Service +ij_java_space_after_closing_angle_bracket_in_type_argument = false +ij_java_space_after_colon = true +ij_java_space_after_comma = true +ij_java_space_after_comma_in_type_arguments = true +ij_java_space_after_for_semicolon = true +ij_java_space_after_quest = true +ij_java_space_after_type_cast = true +ij_java_space_before_annotation_array_initializer_left_brace = false +ij_java_space_before_annotation_parameter_list = false +ij_java_space_before_array_initializer_left_brace = false +ij_java_space_before_catch_keyword = true +ij_java_space_before_catch_left_brace = true +ij_java_space_before_catch_parentheses = true +ij_java_space_before_class_left_brace = true +ij_java_space_before_colon = true +ij_java_space_before_colon_in_foreach = true +ij_java_space_before_comma = false +ij_java_space_before_do_left_brace = true +ij_java_space_before_else_keyword = true +ij_java_space_before_else_left_brace = true +ij_java_space_before_finally_keyword = true +ij_java_space_before_finally_left_brace = true +ij_java_space_before_for_left_brace = true +ij_java_space_before_for_parentheses = true +ij_java_space_before_for_semicolon = false +ij_java_space_before_if_left_brace = true +ij_java_space_before_if_parentheses = true +ij_java_space_before_method_call_parentheses = false +ij_java_space_before_method_left_brace = true +ij_java_space_before_method_parentheses = false +ij_java_space_before_opening_angle_bracket_in_type_parameter = false +ij_java_space_before_quest = true +ij_java_space_before_switch_left_brace = true +ij_java_space_before_switch_parentheses = true +ij_java_space_before_synchronized_left_brace = true +ij_java_space_before_synchronized_parentheses = true +ij_java_space_before_try_left_brace = true +ij_java_space_before_try_parentheses = true +ij_java_space_before_type_parameter_list = false +ij_java_space_before_while_keyword = true +ij_java_space_before_while_left_brace = true +ij_java_space_before_while_parentheses = true +ij_java_space_inside_one_line_enum_braces = false +ij_java_space_within_empty_array_initializer_braces = false +ij_java_space_within_empty_method_call_parentheses = false +ij_java_space_within_empty_method_parentheses = false +ij_java_spaces_around_additive_operators = true +ij_java_spaces_around_annotation_eq = true +ij_java_spaces_around_assignment_operators = true +ij_java_spaces_around_bitwise_operators = true +ij_java_spaces_around_equality_operators = true +ij_java_spaces_around_lambda_arrow = true +ij_java_spaces_around_logical_operators = true +ij_java_spaces_around_method_ref_dbl_colon = false +ij_java_spaces_around_multiplicative_operators = true +ij_java_spaces_around_relational_operators = true +ij_java_spaces_around_shift_operators = true +ij_java_spaces_around_type_bounds_in_type_parameters = true +ij_java_spaces_around_unary_operator = false +ij_java_spaces_within_angle_brackets = false +ij_java_spaces_within_annotation_parentheses = false +ij_java_spaces_within_array_initializer_braces = false +ij_java_spaces_within_braces = false +ij_java_spaces_within_brackets = false +ij_java_spaces_within_cast_parentheses = false +ij_java_spaces_within_catch_parentheses = false +ij_java_spaces_within_for_parentheses = false +ij_java_spaces_within_if_parentheses = false +ij_java_spaces_within_method_call_parentheses = false +ij_java_spaces_within_method_parentheses = false +ij_java_spaces_within_parentheses = false +ij_java_spaces_within_record_header = false +ij_java_spaces_within_switch_parentheses = false +ij_java_spaces_within_synchronized_parentheses = false +ij_java_spaces_within_try_parentheses = false +ij_java_spaces_within_while_parentheses = false +ij_java_special_else_if_treatment = true +ij_java_subclass_name_suffix = Impl +ij_java_ternary_operation_signs_on_next_line = false +ij_java_ternary_operation_wrap = off +ij_java_test_name_suffix = Test +ij_java_throws_keyword_wrap = off +ij_java_throws_list_wrap = off +ij_java_use_external_annotations = false +ij_java_use_fq_class_names = false +ij_java_use_relative_indents = false +ij_java_use_single_class_imports = true +ij_java_variable_annotation_wrap = off +ij_java_visibility = public +ij_java_while_brace_force = never +ij_java_while_on_new_line = false +ij_java_wrap_comments = false +ij_java_wrap_first_method_in_call_chain = false +ij_java_wrap_long_lines = false + +[.editorconfig] +ij_editorconfig_align_group_field_declarations = false +ij_editorconfig_space_after_colon = false +ij_editorconfig_space_after_comma = true +ij_editorconfig_space_before_colon = false +ij_editorconfig_space_before_comma = false +ij_editorconfig_spaces_around_assignment_operators = true + + +[{*.cjs,*.js}] +ij_continuation_indent_size = 4 +ij_javascript_align_imports = false +ij_javascript_align_multiline_array_initializer_expression = false +ij_javascript_align_multiline_binary_operation = false +ij_javascript_align_multiline_chained_methods = false +ij_javascript_align_multiline_extends_list = false +ij_javascript_align_multiline_for = true +ij_javascript_align_multiline_parameters = true +ij_javascript_align_multiline_parameters_in_calls = false +ij_javascript_align_multiline_ternary_operation = false +ij_javascript_align_object_properties = 0 +ij_javascript_align_union_types = false +ij_javascript_align_var_statements = 0 +ij_javascript_array_initializer_new_line_after_left_brace = false +ij_javascript_array_initializer_right_brace_on_new_line = false +ij_javascript_array_initializer_wrap = off +ij_javascript_assignment_wrap = off +ij_javascript_binary_operation_sign_on_next_line = false +ij_javascript_binary_operation_wrap = off +ij_javascript_blacklist_imports = rxjs/Rx,node_modules/**,**/node_modules/**,@angular/material,@angular/material/typings/** +ij_javascript_blank_lines_after_imports = 1 +ij_javascript_blank_lines_around_class = 1 +ij_javascript_blank_lines_around_field = 0 +ij_javascript_blank_lines_around_function = 1 +ij_javascript_blank_lines_around_method = 1 +ij_javascript_block_brace_style = end_of_line +ij_javascript_block_comment_add_space = false +ij_javascript_block_comment_at_first_column = true +ij_javascript_call_parameters_new_line_after_left_paren = false +ij_javascript_call_parameters_right_paren_on_new_line = false +ij_javascript_call_parameters_wrap = off +ij_javascript_catch_on_new_line = false +ij_javascript_chained_call_dot_on_new_line = true +ij_javascript_class_brace_style = end_of_line +ij_javascript_comma_on_new_line = false +ij_javascript_do_while_brace_force = never +ij_javascript_else_on_new_line = false +ij_javascript_enforce_trailing_comma = keep +ij_javascript_extends_keyword_wrap = off +ij_javascript_extends_list_wrap = off +ij_javascript_field_prefix = _ +ij_javascript_file_name_style = relaxed +ij_javascript_finally_on_new_line = false +ij_javascript_for_brace_force = never +ij_javascript_for_statement_new_line_after_left_paren = false +ij_javascript_for_statement_right_paren_on_new_line = false +ij_javascript_for_statement_wrap = off +ij_javascript_force_quote_style = false +ij_javascript_force_semicolon_style = false +ij_javascript_function_expression_brace_style = end_of_line +ij_javascript_if_brace_force = never +ij_javascript_import_merge_members = global +ij_javascript_import_prefer_absolute_path = global +ij_javascript_import_sort_members = true +ij_javascript_import_sort_module_name = false +ij_javascript_import_use_node_resolution = true +ij_javascript_imports_wrap = on_every_item +ij_javascript_indent_case_from_switch = true +ij_javascript_indent_chained_calls = true +ij_javascript_indent_package_children = 0 +ij_javascript_jsx_attribute_value = braces +ij_javascript_keep_blank_lines_in_code = 2 +ij_javascript_keep_first_column_comment = true +ij_javascript_keep_indents_on_empty_lines = false +ij_javascript_keep_line_breaks = true +ij_javascript_keep_simple_blocks_in_one_line = false +ij_javascript_keep_simple_methods_in_one_line = false +ij_javascript_line_comment_add_space = true +ij_javascript_line_comment_at_first_column = false +ij_javascript_method_brace_style = end_of_line +ij_javascript_method_call_chain_wrap = off +ij_javascript_method_parameters_new_line_after_left_paren = false +ij_javascript_method_parameters_right_paren_on_new_line = false +ij_javascript_method_parameters_wrap = off +ij_javascript_object_literal_wrap = on_every_item +ij_javascript_parentheses_expression_new_line_after_left_paren = false +ij_javascript_parentheses_expression_right_paren_on_new_line = false +ij_javascript_place_assignment_sign_on_next_line = false +ij_javascript_prefer_as_type_cast = false +ij_javascript_prefer_explicit_types_function_expression_returns = false +ij_javascript_prefer_explicit_types_function_returns = false +ij_javascript_prefer_explicit_types_vars_fields = false +ij_javascript_prefer_parameters_wrap = false +ij_javascript_reformat_c_style_comments = false +ij_javascript_space_after_colon = true +ij_javascript_space_after_comma = true +ij_javascript_space_after_dots_in_rest_parameter = false +ij_javascript_space_after_generator_mult = true +ij_javascript_space_after_property_colon = true +ij_javascript_space_after_quest = true +ij_javascript_space_after_type_colon = true +ij_javascript_space_after_unary_not = false +ij_javascript_space_before_async_arrow_lparen = true +ij_javascript_space_before_catch_keyword = true +ij_javascript_space_before_catch_left_brace = true +ij_javascript_space_before_catch_parentheses = true +ij_javascript_space_before_class_lbrace = true +ij_javascript_space_before_class_left_brace = true +ij_javascript_space_before_colon = true +ij_javascript_space_before_comma = false +ij_javascript_space_before_do_left_brace = true +ij_javascript_space_before_else_keyword = true +ij_javascript_space_before_else_left_brace = true +ij_javascript_space_before_finally_keyword = true +ij_javascript_space_before_finally_left_brace = true +ij_javascript_space_before_for_left_brace = true +ij_javascript_space_before_for_parentheses = true +ij_javascript_space_before_for_semicolon = false +ij_javascript_space_before_function_left_parenth = true +ij_javascript_space_before_generator_mult = false +ij_javascript_space_before_if_left_brace = true +ij_javascript_space_before_if_parentheses = true +ij_javascript_space_before_method_call_parentheses = false +ij_javascript_space_before_method_left_brace = true +ij_javascript_space_before_method_parentheses = false +ij_javascript_space_before_property_colon = false +ij_javascript_space_before_quest = true +ij_javascript_space_before_switch_left_brace = true +ij_javascript_space_before_switch_parentheses = true +ij_javascript_space_before_try_left_brace = true +ij_javascript_space_before_type_colon = false +ij_javascript_space_before_unary_not = false +ij_javascript_space_before_while_keyword = true +ij_javascript_space_before_while_left_brace = true +ij_javascript_space_before_while_parentheses = true +ij_javascript_spaces_around_additive_operators = true +ij_javascript_spaces_around_arrow_function_operator = true +ij_javascript_spaces_around_assignment_operators = true +ij_javascript_spaces_around_bitwise_operators = true +ij_javascript_spaces_around_equality_operators = true +ij_javascript_spaces_around_logical_operators = true +ij_javascript_spaces_around_multiplicative_operators = true +ij_javascript_spaces_around_relational_operators = true +ij_javascript_spaces_around_shift_operators = true +ij_javascript_spaces_around_unary_operator = false +ij_javascript_spaces_within_array_initializer_brackets = false +ij_javascript_spaces_within_brackets = false +ij_javascript_spaces_within_catch_parentheses = false +ij_javascript_spaces_within_for_parentheses = false +ij_javascript_spaces_within_if_parentheses = false +ij_javascript_spaces_within_imports = false +ij_javascript_spaces_within_interpolation_expressions = false +ij_javascript_spaces_within_method_call_parentheses = false +ij_javascript_spaces_within_method_parentheses = false +ij_javascript_spaces_within_object_literal_braces = false +ij_javascript_spaces_within_object_type_braces = true +ij_javascript_spaces_within_parentheses = false +ij_javascript_spaces_within_switch_parentheses = false +ij_javascript_spaces_within_type_assertion = false +ij_javascript_spaces_within_union_types = true +ij_javascript_spaces_within_while_parentheses = false +ij_javascript_special_else_if_treatment = true +ij_javascript_ternary_operation_signs_on_next_line = false +ij_javascript_ternary_operation_wrap = off +ij_javascript_union_types_wrap = on_every_item +ij_javascript_use_chained_calls_group_indents = false +ij_javascript_use_double_quotes = true +ij_javascript_use_explicit_js_extension = auto +ij_javascript_use_path_mapping = always +ij_javascript_use_public_modifier = false +ij_javascript_use_semicolon_after_statement = true +ij_javascript_var_declaration_wrap = normal +ij_javascript_while_brace_force = never +ij_javascript_while_on_new_line = false +ij_javascript_wrap_comments = false + +[{*.ctp,*.hphp,*.inc,*.module,*.php,*.php4,*.php5,*.phtml}] +ij_continuation_indent_size = 4 +ij_php_align_assignments = false +ij_php_align_class_constants = false +ij_php_align_group_field_declarations = false +ij_php_align_inline_comments = false +ij_php_align_key_value_pairs = false +ij_php_align_match_arm_bodies = false +ij_php_align_multiline_array_initializer_expression = false +ij_php_align_multiline_binary_operation = false +ij_php_align_multiline_chained_methods = false +ij_php_align_multiline_extends_list = false +ij_php_align_multiline_for = true +ij_php_align_multiline_parameters = true +ij_php_align_multiline_parameters_in_calls = false +ij_php_align_multiline_ternary_operation = false +ij_php_align_named_arguments = false +ij_php_align_phpdoc_comments = false +ij_php_align_phpdoc_param_names = false +ij_php_anonymous_brace_style = end_of_line +ij_php_api_weight = 28 +ij_php_array_initializer_new_line_after_left_brace = false +ij_php_array_initializer_right_brace_on_new_line = false +ij_php_array_initializer_wrap = off +ij_php_assignment_wrap = off +ij_php_attributes_wrap = off +ij_php_author_weight = 28 +ij_php_binary_operation_sign_on_next_line = false +ij_php_binary_operation_wrap = off +ij_php_blank_lines_after_class_header = 0 +ij_php_blank_lines_after_function = 1 +ij_php_blank_lines_after_imports = 1 +ij_php_blank_lines_after_opening_tag = 0 +ij_php_blank_lines_after_package = 0 +ij_php_blank_lines_around_class = 1 +ij_php_blank_lines_around_constants = 0 +ij_php_blank_lines_around_field = 0 +ij_php_blank_lines_around_method = 1 +ij_php_blank_lines_before_class_end = 0 +ij_php_blank_lines_before_imports = 1 +ij_php_blank_lines_before_method_body = 0 +ij_php_blank_lines_before_package = 1 +ij_php_blank_lines_before_return_statement = 0 +ij_php_blank_lines_between_imports = 0 +ij_php_block_brace_style = end_of_line +ij_php_call_parameters_new_line_after_left_paren = false +ij_php_call_parameters_right_paren_on_new_line = false +ij_php_call_parameters_wrap = off +ij_php_catch_on_new_line = false +ij_php_category_weight = 28 +ij_php_class_brace_style = next_line +ij_php_comma_after_last_argument = false +ij_php_comma_after_last_array_element = false +ij_php_comma_after_last_closure_use_var = false +ij_php_comma_after_last_parameter = false +ij_php_concat_spaces = true +ij_php_copyright_weight = 28 +ij_php_deprecated_weight = 28 +ij_php_do_while_brace_force = never +ij_php_else_if_style = as_is +ij_php_else_on_new_line = false +ij_php_example_weight = 28 +ij_php_extends_keyword_wrap = off +ij_php_extends_list_wrap = off +ij_php_fields_default_visibility = private +ij_php_filesource_weight = 28 +ij_php_finally_on_new_line = false +ij_php_for_brace_force = never +ij_php_for_statement_new_line_after_left_paren = false +ij_php_for_statement_right_paren_on_new_line = false +ij_php_for_statement_wrap = off +ij_php_force_empty_methods_in_one_line = false +ij_php_force_short_declaration_array_style = false +ij_php_getters_setters_naming_style = camel_case +ij_php_getters_setters_order_style = getters_first +ij_php_global_weight = 28 +ij_php_group_use_wrap = on_every_item +ij_php_if_brace_force = never +ij_php_if_lparen_on_next_line = false +ij_php_if_rparen_on_next_line = false +ij_php_ignore_weight = 28 +ij_php_import_sorting = alphabetic +ij_php_indent_break_from_case = true +ij_php_indent_case_from_switch = true +ij_php_indent_code_in_php_tags = false +ij_php_internal_weight = 28 +ij_php_keep_blank_lines_after_lbrace = 2 +ij_php_keep_blank_lines_before_right_brace = 2 +ij_php_keep_blank_lines_in_code = 2 +ij_php_keep_blank_lines_in_declarations = 2 +ij_php_keep_control_statement_in_one_line = true +ij_php_keep_first_column_comment = true +ij_php_keep_indents_on_empty_lines = false +ij_php_keep_line_breaks = true +ij_php_keep_rparen_and_lbrace_on_one_line = false +ij_php_keep_simple_classes_in_one_line = false +ij_php_keep_simple_methods_in_one_line = false +ij_php_lambda_brace_style = end_of_line +ij_php_license_weight = 28 +ij_php_line_comment_add_space = false +ij_php_line_comment_at_first_column = true +ij_php_link_weight = 28 +ij_php_lower_case_boolean_const = false +ij_php_lower_case_keywords = true +ij_php_lower_case_null_const = false +ij_php_method_brace_style = next_line +ij_php_method_call_chain_wrap = off +ij_php_method_parameters_new_line_after_left_paren = false +ij_php_method_parameters_right_paren_on_new_line = false +ij_php_method_parameters_wrap = off +ij_php_method_weight = 28 +ij_php_modifier_list_wrap = false +ij_php_multiline_chained_calls_semicolon_on_new_line = false +ij_php_namespace_brace_style = 1 +ij_php_new_line_after_php_opening_tag = false +ij_php_null_type_position = in_the_end +ij_php_package_weight = 28 +ij_php_param_weight = 0 +ij_php_parameters_attributes_wrap = off +ij_php_parentheses_expression_new_line_after_left_paren = false +ij_php_parentheses_expression_right_paren_on_new_line = false +ij_php_phpdoc_blank_line_before_tags = false +ij_php_phpdoc_blank_lines_around_parameters = false +ij_php_phpdoc_keep_blank_lines = true +ij_php_phpdoc_param_spaces_between_name_and_description = 1 +ij_php_phpdoc_param_spaces_between_tag_and_type = 1 +ij_php_phpdoc_param_spaces_between_type_and_name = 1 +ij_php_phpdoc_use_fqcn = false +ij_php_phpdoc_wrap_long_lines = false +ij_php_place_assignment_sign_on_next_line = false +ij_php_place_parens_for_constructor = 0 +ij_php_property_read_weight = 28 +ij_php_property_weight = 28 +ij_php_property_write_weight = 28 +ij_php_return_type_on_new_line = false +ij_php_return_weight = 1 +ij_php_see_weight = 28 +ij_php_since_weight = 28 +ij_php_sort_phpdoc_elements = true +ij_php_space_after_colon = true +ij_php_space_after_colon_in_enum_backed_type = true +ij_php_space_after_colon_in_named_argument = true +ij_php_space_after_colon_in_return_type = true +ij_php_space_after_comma = true +ij_php_space_after_for_semicolon = true +ij_php_space_after_quest = true +ij_php_space_after_type_cast = false +ij_php_space_after_unary_not = false +ij_php_space_before_array_initializer_left_brace = false +ij_php_space_before_catch_keyword = true +ij_php_space_before_catch_left_brace = true +ij_php_space_before_catch_parentheses = true +ij_php_space_before_class_left_brace = true +ij_php_space_before_closure_left_parenthesis = true +ij_php_space_before_colon = true +ij_php_space_before_colon_in_enum_backed_type = false +ij_php_space_before_colon_in_named_argument = false +ij_php_space_before_colon_in_return_type = false +ij_php_space_before_comma = false +ij_php_space_before_do_left_brace = true +ij_php_space_before_else_keyword = true +ij_php_space_before_else_left_brace = true +ij_php_space_before_finally_keyword = true +ij_php_space_before_finally_left_brace = true +ij_php_space_before_for_left_brace = true +ij_php_space_before_for_parentheses = true +ij_php_space_before_for_semicolon = false +ij_php_space_before_if_left_brace = true +ij_php_space_before_if_parentheses = true +ij_php_space_before_method_call_parentheses = false +ij_php_space_before_method_left_brace = true +ij_php_space_before_method_parentheses = false +ij_php_space_before_quest = true +ij_php_space_before_short_closure_left_parenthesis = false +ij_php_space_before_switch_left_brace = true +ij_php_space_before_switch_parentheses = true +ij_php_space_before_try_left_brace = true +ij_php_space_before_unary_not = false +ij_php_space_before_while_keyword = true +ij_php_space_before_while_left_brace = true +ij_php_space_before_while_parentheses = true +ij_php_space_between_ternary_quest_and_colon = false +ij_php_spaces_around_additive_operators = true +ij_php_spaces_around_arrow = false +ij_php_spaces_around_assignment_in_declare = false +ij_php_spaces_around_assignment_operators = true +ij_php_spaces_around_bitwise_operators = true +ij_php_spaces_around_equality_operators = true +ij_php_spaces_around_logical_operators = true +ij_php_spaces_around_multiplicative_operators = true +ij_php_spaces_around_null_coalesce_operator = true +ij_php_spaces_around_pipe_in_union_type = false +ij_php_spaces_around_relational_operators = true +ij_php_spaces_around_shift_operators = true +ij_php_spaces_around_unary_operator = false +ij_php_spaces_around_var_within_brackets = false +ij_php_spaces_within_array_initializer_braces = false +ij_php_spaces_within_brackets = false +ij_php_spaces_within_catch_parentheses = false +ij_php_spaces_within_for_parentheses = false +ij_php_spaces_within_if_parentheses = false +ij_php_spaces_within_method_call_parentheses = false +ij_php_spaces_within_method_parentheses = false +ij_php_spaces_within_parentheses = false +ij_php_spaces_within_short_echo_tags = true +ij_php_spaces_within_switch_parentheses = false +ij_php_spaces_within_while_parentheses = false +ij_php_special_else_if_treatment = false +ij_php_subpackage_weight = 28 +ij_php_ternary_operation_signs_on_next_line = false +ij_php_ternary_operation_wrap = off +ij_php_throws_weight = 2 +ij_php_todo_weight = 28 +ij_php_treat_multiline_arrays_and_lambdas_multiline = false +ij_php_unknown_tag_weight = 28 +ij_php_upper_case_boolean_const = false +ij_php_upper_case_null_const = false +ij_php_uses_weight = 28 +ij_php_var_weight = 28 +ij_php_variable_naming_style = mixed +ij_php_version_weight = 28 +ij_php_while_brace_force = never +ij_php_while_on_new_line = false + +[{*.gant,*.groovy,*.gy}] +ij_groovy_align_group_field_declarations = false +ij_groovy_align_multiline_array_initializer_expression = false +ij_groovy_align_multiline_assignment = false +ij_groovy_align_multiline_binary_operation = false +ij_groovy_align_multiline_chained_methods = false +ij_groovy_align_multiline_extends_list = false +ij_groovy_align_multiline_for = true +ij_groovy_align_multiline_list_or_map = true +ij_groovy_align_multiline_method_parentheses = false +ij_groovy_align_multiline_parameters = true +ij_groovy_align_multiline_parameters_in_calls = false +ij_groovy_align_multiline_resources = true +ij_groovy_align_multiline_ternary_operation = false +ij_groovy_align_multiline_throws_list = false +ij_groovy_align_named_args_in_map = true +ij_groovy_align_throws_keyword = false +ij_groovy_array_initializer_new_line_after_left_brace = false +ij_groovy_array_initializer_right_brace_on_new_line = false +ij_groovy_array_initializer_wrap = off +ij_groovy_assert_statement_wrap = off +ij_groovy_assignment_wrap = off +ij_groovy_binary_operation_wrap = off +ij_groovy_blank_lines_after_class_header = 0 +ij_groovy_blank_lines_after_imports = 1 +ij_groovy_blank_lines_after_package = 1 +ij_groovy_blank_lines_around_class = 1 +ij_groovy_blank_lines_around_field = 0 +ij_groovy_blank_lines_around_field_in_interface = 0 +ij_groovy_blank_lines_around_method = 1 +ij_groovy_blank_lines_around_method_in_interface = 1 +ij_groovy_blank_lines_before_imports = 1 +ij_groovy_blank_lines_before_method_body = 0 +ij_groovy_blank_lines_before_package = 0 +ij_groovy_block_brace_style = end_of_line +ij_groovy_block_comment_add_space = false +ij_groovy_block_comment_at_first_column = true +ij_groovy_call_parameters_new_line_after_left_paren = false +ij_groovy_call_parameters_right_paren_on_new_line = false +ij_groovy_call_parameters_wrap = off +ij_groovy_catch_on_new_line = false +ij_groovy_class_annotation_wrap = split_into_lines +ij_groovy_class_brace_style = end_of_line +ij_groovy_class_count_to_use_import_on_demand = 5 +ij_groovy_do_while_brace_force = never +ij_groovy_else_on_new_line = false +ij_groovy_enable_groovydoc_formatting = true +ij_groovy_enum_constants_wrap = off +ij_groovy_extends_keyword_wrap = off +ij_groovy_extends_list_wrap = off +ij_groovy_field_annotation_wrap = split_into_lines +ij_groovy_finally_on_new_line = false +ij_groovy_for_brace_force = never +ij_groovy_for_statement_new_line_after_left_paren = false +ij_groovy_for_statement_right_paren_on_new_line = false +ij_groovy_for_statement_wrap = off +ij_groovy_ginq_general_clause_wrap_policy = 2 +ij_groovy_ginq_having_wrap_policy = 1 +ij_groovy_ginq_indent_having_clause = true +ij_groovy_ginq_indent_on_clause = true +ij_groovy_ginq_on_wrap_policy = 1 +ij_groovy_ginq_space_after_keyword = true +ij_groovy_if_brace_force = never +ij_groovy_import_annotation_wrap = 2 +ij_groovy_imports_layout = *,|,javax.**,java.**,|,$* +ij_groovy_indent_case_from_switch = true +ij_groovy_indent_label_blocks = true +ij_groovy_insert_inner_class_imports = false +ij_groovy_keep_blank_lines_before_right_brace = 2 +ij_groovy_keep_blank_lines_in_code = 2 +ij_groovy_keep_blank_lines_in_declarations = 2 +ij_groovy_keep_control_statement_in_one_line = true +ij_groovy_keep_first_column_comment = true +ij_groovy_keep_indents_on_empty_lines = false +ij_groovy_keep_line_breaks = true +ij_groovy_keep_multiple_expressions_in_one_line = false +ij_groovy_keep_simple_blocks_in_one_line = false +ij_groovy_keep_simple_classes_in_one_line = true +ij_groovy_keep_simple_lambdas_in_one_line = true +ij_groovy_keep_simple_methods_in_one_line = true +ij_groovy_label_indent_absolute = false +ij_groovy_label_indent_size = 0 +ij_groovy_lambda_brace_style = end_of_line +ij_groovy_layout_static_imports_separately = true +ij_groovy_line_comment_add_space = false +ij_groovy_line_comment_add_space_on_reformat = false +ij_groovy_line_comment_at_first_column = true +ij_groovy_method_annotation_wrap = split_into_lines +ij_groovy_method_brace_style = end_of_line +ij_groovy_method_call_chain_wrap = off +ij_groovy_method_parameters_new_line_after_left_paren = false +ij_groovy_method_parameters_right_paren_on_new_line = false +ij_groovy_method_parameters_wrap = off +ij_groovy_modifier_list_wrap = false +ij_groovy_names_count_to_use_import_on_demand = 3 +ij_groovy_packages_to_use_import_on_demand = java.awt.*,javax.swing.* +ij_groovy_parameter_annotation_wrap = off +ij_groovy_parentheses_expression_new_line_after_left_paren = false +ij_groovy_parentheses_expression_right_paren_on_new_line = false +ij_groovy_prefer_parameters_wrap = false +ij_groovy_resource_list_new_line_after_left_paren = false +ij_groovy_resource_list_right_paren_on_new_line = false +ij_groovy_resource_list_wrap = off +ij_groovy_space_after_assert_separator = true +ij_groovy_space_after_colon = true +ij_groovy_space_after_comma = true +ij_groovy_space_after_comma_in_type_arguments = true +ij_groovy_space_after_for_semicolon = true +ij_groovy_space_after_quest = true +ij_groovy_space_after_type_cast = true +ij_groovy_space_before_annotation_parameter_list = false +ij_groovy_space_before_array_initializer_left_brace = false +ij_groovy_space_before_assert_separator = false +ij_groovy_space_before_catch_keyword = true +ij_groovy_space_before_catch_left_brace = true +ij_groovy_space_before_catch_parentheses = true +ij_groovy_space_before_class_left_brace = true +ij_groovy_space_before_closure_left_brace = true +ij_groovy_space_before_colon = true +ij_groovy_space_before_comma = false +ij_groovy_space_before_do_left_brace = true +ij_groovy_space_before_else_keyword = true +ij_groovy_space_before_else_left_brace = true +ij_groovy_space_before_finally_keyword = true +ij_groovy_space_before_finally_left_brace = true +ij_groovy_space_before_for_left_brace = true +ij_groovy_space_before_for_parentheses = true +ij_groovy_space_before_for_semicolon = false +ij_groovy_space_before_if_left_brace = true +ij_groovy_space_before_if_parentheses = true +ij_groovy_space_before_method_call_parentheses = false +ij_groovy_space_before_method_left_brace = true +ij_groovy_space_before_method_parentheses = false +ij_groovy_space_before_quest = true +ij_groovy_space_before_record_parentheses = false +ij_groovy_space_before_switch_left_brace = true +ij_groovy_space_before_switch_parentheses = true +ij_groovy_space_before_synchronized_left_brace = true +ij_groovy_space_before_synchronized_parentheses = true +ij_groovy_space_before_try_left_brace = true +ij_groovy_space_before_try_parentheses = true +ij_groovy_space_before_while_keyword = true +ij_groovy_space_before_while_left_brace = true +ij_groovy_space_before_while_parentheses = true +ij_groovy_space_in_named_argument = true +ij_groovy_space_in_named_argument_before_colon = false +ij_groovy_space_within_empty_array_initializer_braces = false +ij_groovy_space_within_empty_method_call_parentheses = false +ij_groovy_spaces_around_additive_operators = true +ij_groovy_spaces_around_assignment_operators = true +ij_groovy_spaces_around_bitwise_operators = true +ij_groovy_spaces_around_equality_operators = true +ij_groovy_spaces_around_lambda_arrow = true +ij_groovy_spaces_around_logical_operators = true +ij_groovy_spaces_around_multiplicative_operators = true +ij_groovy_spaces_around_regex_operators = true +ij_groovy_spaces_around_relational_operators = true +ij_groovy_spaces_around_shift_operators = true +ij_groovy_spaces_within_annotation_parentheses = false +ij_groovy_spaces_within_array_initializer_braces = false +ij_groovy_spaces_within_braces = true +ij_groovy_spaces_within_brackets = false +ij_groovy_spaces_within_cast_parentheses = false +ij_groovy_spaces_within_catch_parentheses = false +ij_groovy_spaces_within_for_parentheses = false +ij_groovy_spaces_within_gstring_injection_braces = false +ij_groovy_spaces_within_if_parentheses = false +ij_groovy_spaces_within_list_or_map = false +ij_groovy_spaces_within_method_call_parentheses = false +ij_groovy_spaces_within_method_parentheses = false +ij_groovy_spaces_within_parentheses = false +ij_groovy_spaces_within_switch_parentheses = false +ij_groovy_spaces_within_synchronized_parentheses = false +ij_groovy_spaces_within_try_parentheses = false +ij_groovy_spaces_within_tuple_expression = false +ij_groovy_spaces_within_while_parentheses = false +ij_groovy_special_else_if_treatment = true +ij_groovy_ternary_operation_wrap = off +ij_groovy_throws_keyword_wrap = off +ij_groovy_throws_list_wrap = off +ij_groovy_use_flying_geese_braces = false +ij_groovy_use_fq_class_names = false +ij_groovy_use_fq_class_names_in_javadoc = true +ij_groovy_use_relative_indents = false +ij_groovy_use_single_class_imports = true +ij_groovy_variable_annotation_wrap = off +ij_groovy_while_brace_force = never +ij_groovy_while_on_new_line = false +ij_groovy_wrap_chain_calls_after_dot = false +ij_groovy_wrap_long_lines = false + +[{*.gradle.kts,*.kt,*.kts,*.main.kts,*.space.kts}] +ij_kotlin_align_in_columns_case_branch = false +ij_kotlin_align_multiline_binary_operation = false +ij_kotlin_align_multiline_extends_list = false +ij_kotlin_align_multiline_method_parentheses = false +ij_kotlin_align_multiline_parameters = true +ij_kotlin_align_multiline_parameters_in_calls = false +ij_kotlin_allow_trailing_comma = false +ij_kotlin_allow_trailing_comma_on_call_site = false +ij_kotlin_assignment_wrap = off +ij_kotlin_blank_lines_after_class_header = 0 +ij_kotlin_blank_lines_around_block_when_branches = 0 +ij_kotlin_blank_lines_before_declaration_with_comment_or_annotation_on_separate_line = 1 +ij_kotlin_block_comment_add_space = false +ij_kotlin_block_comment_at_first_column = true +ij_kotlin_call_parameters_new_line_after_left_paren = false +ij_kotlin_call_parameters_right_paren_on_new_line = false +ij_kotlin_call_parameters_wrap = off +ij_kotlin_catch_on_new_line = false +ij_kotlin_class_annotation_wrap = split_into_lines +ij_kotlin_continuation_indent_for_chained_calls = true +ij_kotlin_continuation_indent_for_expression_bodies = true +ij_kotlin_continuation_indent_in_argument_lists = true +ij_kotlin_continuation_indent_in_elvis = true +ij_kotlin_continuation_indent_in_if_conditions = true +ij_kotlin_continuation_indent_in_parameter_lists = true +ij_kotlin_continuation_indent_in_supertype_lists = true +ij_kotlin_else_on_new_line = false +ij_kotlin_enum_constants_wrap = off +ij_kotlin_extends_list_wrap = off +ij_kotlin_field_annotation_wrap = split_into_lines +ij_kotlin_finally_on_new_line = false +ij_kotlin_if_rparen_on_new_line = false +ij_kotlin_import_nested_classes = false +ij_kotlin_imports_layout = *,java.**,javax.**,kotlin.**,^ +ij_kotlin_insert_whitespaces_in_simple_one_line_method = true +ij_kotlin_keep_blank_lines_before_right_brace = 2 +ij_kotlin_keep_blank_lines_in_code = 2 +ij_kotlin_keep_blank_lines_in_declarations = 2 +ij_kotlin_keep_first_column_comment = true +ij_kotlin_keep_indents_on_empty_lines = false +ij_kotlin_keep_line_breaks = true +ij_kotlin_lbrace_on_next_line = false +ij_kotlin_line_break_after_multiline_when_entry = true +ij_kotlin_line_comment_add_space = false +ij_kotlin_line_comment_add_space_on_reformat = false +ij_kotlin_line_comment_at_first_column = true +ij_kotlin_method_annotation_wrap = split_into_lines +ij_kotlin_method_call_chain_wrap = off +ij_kotlin_method_parameters_new_line_after_left_paren = false +ij_kotlin_method_parameters_right_paren_on_new_line = false +ij_kotlin_method_parameters_wrap = off +ij_kotlin_name_count_to_use_star_import = 5 +ij_kotlin_name_count_to_use_star_import_for_members = 3 +ij_kotlin_packages_to_use_import_on_demand = java.util.*,kotlinx.android.synthetic.**,io.ktor.** +ij_kotlin_parameter_annotation_wrap = off +ij_kotlin_space_after_comma = true +ij_kotlin_space_after_extend_colon = true +ij_kotlin_space_after_type_colon = true +ij_kotlin_space_before_catch_parentheses = true +ij_kotlin_space_before_comma = false +ij_kotlin_space_before_extend_colon = true +ij_kotlin_space_before_for_parentheses = true +ij_kotlin_space_before_if_parentheses = true +ij_kotlin_space_before_lambda_arrow = true +ij_kotlin_space_before_type_colon = false +ij_kotlin_space_before_when_parentheses = true +ij_kotlin_space_before_while_parentheses = true +ij_kotlin_spaces_around_additive_operators = true +ij_kotlin_spaces_around_assignment_operators = true +ij_kotlin_spaces_around_equality_operators = true +ij_kotlin_spaces_around_function_type_arrow = true +ij_kotlin_spaces_around_logical_operators = true +ij_kotlin_spaces_around_multiplicative_operators = true +ij_kotlin_spaces_around_range = false +ij_kotlin_spaces_around_relational_operators = true +ij_kotlin_spaces_around_unary_operator = false +ij_kotlin_spaces_around_when_arrow = true +ij_kotlin_variable_annotation_wrap = off +ij_kotlin_while_on_new_line = false +ij_kotlin_wrap_elvis_expressions = 1 +ij_kotlin_wrap_expression_body_functions = 0 +ij_kotlin_wrap_first_method_in_call_chain = false + +[{*.har,*.jsb2,*.jsb3,*.json,.babelrc,.eslintrc,.stylelintrc,bowerrc,composer.lock,jest.config}] +indent_size = 2 +ij_json_array_wrapping = split_into_lines +ij_json_keep_blank_lines_in_code = 0 +ij_json_keep_indents_on_empty_lines = false +ij_json_keep_line_breaks = true +ij_json_keep_trailing_comma = false +ij_json_object_wrapping = split_into_lines +ij_json_property_alignment = do_not_align +ij_json_space_after_colon = true +ij_json_space_after_comma = true +ij_json_space_before_colon = false +ij_json_space_before_comma = false +ij_json_spaces_within_braces = false +ij_json_spaces_within_brackets = false +ij_json_wrap_long_lines = false + +[{*.htm,*.html,*.ng,*.sht,*.shtm,*.shtml}] +ij_html_add_new_line_before_tags = body,div,p,form,h1,h2,h3 +ij_html_align_attributes = true +ij_html_align_text = false +ij_html_attribute_wrap = normal +ij_html_block_comment_add_space = false +ij_html_block_comment_at_first_column = true +ij_html_do_not_align_children_of_min_lines = 0 +ij_html_do_not_break_if_inline_tags = title,h1,h2,h3,h4,h5,h6,p +ij_html_do_not_indent_children_of_tags = html,body,thead,tbody,tfoot +ij_html_enforce_quotes = false +ij_html_inline_tags = a,abbr,acronym,b,basefont,bdo,big,br,cite,cite,code,dfn,em,font,i,img,input,kbd,label,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var +ij_html_keep_blank_lines = 2 +ij_html_keep_indents_on_empty_lines = false +ij_html_keep_line_breaks = true +ij_html_keep_line_breaks_in_text = true +ij_html_keep_whitespaces = false +ij_html_keep_whitespaces_inside = span,pre,textarea +ij_html_line_comment_at_first_column = true +ij_html_new_line_after_last_attribute = never +ij_html_new_line_before_first_attribute = never +ij_html_quote_style = double +ij_html_remove_new_line_before_tags = br +ij_html_space_after_tag_name = false +ij_html_space_around_equality_in_attribute = false +ij_html_space_inside_empty_tag = false +ij_html_text_wrap = normal + +[{*.j2,*.yaml,*.yml,.analysis_options,pubspec.lock}] +indent_size = 2 +ij_yaml_align_values_properties = do_not_align +ij_yaml_autoinsert_sequence_marker = true +ij_yaml_block_mapping_on_new_line = false +ij_yaml_indent_sequence_value = true +ij_yaml_keep_indents_on_empty_lines = false +ij_yaml_keep_line_breaks = true +ij_yaml_sequence_on_new_line = false +ij_yaml_space_before_colon = false +ij_yaml_spaces_within_braces = true +ij_yaml_spaces_within_brackets = true + +[{*.jsf,*.jsp,*.jspf,*.tag,*.tagf,*.xjsp}] +ij_jsp_jsp_prefer_comma_separated_import_list = false +ij_jsp_keep_indents_on_empty_lines = false + +[{*.jspx,*.tagx}] +ij_jspx_keep_indents_on_empty_lines = false + +[{*.markdown,*.md}] +ij_markdown_force_one_space_after_blockquote_symbol = true +ij_markdown_force_one_space_after_header_symbol = true +ij_markdown_force_one_space_after_list_bullet = true +ij_markdown_force_one_space_between_words = true +ij_markdown_insert_quote_arrows_on_wrap = true +ij_markdown_keep_indents_on_empty_lines = false +ij_markdown_keep_line_breaks_inside_text_blocks = true +ij_markdown_max_lines_around_block_elements = 1 +ij_markdown_max_lines_around_header = 1 +ij_markdown_max_lines_between_paragraphs = 1 +ij_markdown_min_lines_around_block_elements = 1 +ij_markdown_min_lines_around_header = 1 +ij_markdown_min_lines_between_paragraphs = 1 +ij_markdown_wrap_text_if_long = true +ij_markdown_wrap_text_inside_blockquotes = true + +[{*.pb,*.textproto}] +indent_size = 2 +tab_width = 2 +ij_continuation_indent_size = 4 +ij_prototext_keep_blank_lines_in_code = 2 +ij_prototext_keep_indents_on_empty_lines = false +ij_prototext_keep_line_breaks = true +ij_prototext_space_after_colon = true +ij_prototext_space_after_comma = true +ij_prototext_space_before_colon = false +ij_prototext_space_before_comma = false +ij_prototext_spaces_within_braces = true +ij_prototext_spaces_within_brackets = false + +[{*.properties,*.property,spring.handlers,spring.schemas}] +ij_properties_align_group_field_declarations = false +ij_properties_keep_blank_lines = false +ij_properties_key_value_delimiter = equals +ij_properties_spaces_around_key_value_delimiter = false + +[{*.py,*.pyw}] +ij_python_align_collections_and_comprehensions = true +ij_python_align_multiline_imports = true +ij_python_align_multiline_parameters = true +ij_python_align_multiline_parameters_in_calls = true +ij_python_blank_line_at_file_end = true +ij_python_blank_lines_after_imports = 1 +ij_python_blank_lines_after_local_imports = 0 +ij_python_blank_lines_around_class = 1 +ij_python_blank_lines_around_method = 1 +ij_python_blank_lines_around_top_level_classes_functions = 2 +ij_python_blank_lines_before_first_method = 0 +ij_python_call_parameters_new_line_after_left_paren = false +ij_python_call_parameters_right_paren_on_new_line = false +ij_python_call_parameters_wrap = normal +ij_python_dict_alignment = 0 +ij_python_dict_new_line_after_left_brace = false +ij_python_dict_new_line_before_right_brace = false +ij_python_dict_wrapping = 1 +ij_python_from_import_new_line_after_left_parenthesis = false +ij_python_from_import_new_line_before_right_parenthesis = false +ij_python_from_import_parentheses_force_if_multiline = false +ij_python_from_import_trailing_comma_if_multiline = false +ij_python_from_import_wrapping = 1 +ij_python_hang_closing_brackets = false +ij_python_keep_blank_lines_in_code = 1 +ij_python_keep_blank_lines_in_declarations = 1 +ij_python_keep_indents_on_empty_lines = false +ij_python_keep_line_breaks = true +ij_python_method_parameters_new_line_after_left_paren = false +ij_python_method_parameters_right_paren_on_new_line = false +ij_python_method_parameters_wrap = normal +ij_python_new_line_after_colon = false +ij_python_new_line_after_colon_multi_clause = true +ij_python_optimize_imports_always_split_from_imports = false +ij_python_optimize_imports_case_insensitive_order = false +ij_python_optimize_imports_join_from_imports_with_same_source = false +ij_python_optimize_imports_sort_by_type_first = true +ij_python_optimize_imports_sort_imports = true +ij_python_optimize_imports_sort_names_in_from_imports = false +ij_python_space_after_comma = true +ij_python_space_after_number_sign = true +ij_python_space_after_py_colon = true +ij_python_space_before_backslash = true +ij_python_space_before_comma = false +ij_python_space_before_for_semicolon = false +ij_python_space_before_lbracket = false +ij_python_space_before_method_call_parentheses = false +ij_python_space_before_method_parentheses = false +ij_python_space_before_number_sign = true +ij_python_space_before_py_colon = false +ij_python_space_within_empty_method_call_parentheses = false +ij_python_space_within_empty_method_parentheses = false +ij_python_spaces_around_additive_operators = true +ij_python_spaces_around_assignment_operators = true +ij_python_spaces_around_bitwise_operators = true +ij_python_spaces_around_eq_in_keyword_argument = false +ij_python_spaces_around_eq_in_named_parameter = false +ij_python_spaces_around_equality_operators = true +ij_python_spaces_around_multiplicative_operators = true +ij_python_spaces_around_power_operator = true +ij_python_spaces_around_relational_operators = true +ij_python_spaces_around_shift_operators = true +ij_python_spaces_within_braces = false +ij_python_spaces_within_brackets = false +ij_python_spaces_within_method_call_parentheses = false +ij_python_spaces_within_method_parentheses = false +ij_python_use_continuation_indent_for_arguments = false +ij_python_use_continuation_indent_for_collection_and_comprehensions = false +ij_python_use_continuation_indent_for_parameters = true +ij_python_wrap_long_lines = false + +[{*.qute.htm,*.qute.html,*.qute.json,*.qute.txt,*.qute.yaml,*.qute.yml}] +ij_qute_keep_indents_on_empty_lines = false + +[{*.toml,Cargo.lock,Cargo.toml.orig,Gopkg.lock,Pipfile,poetry.lock}] +ij_toml_keep_indents_on_empty_lines = false diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e45fac8..6d96edc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,7 @@ When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change. ## Pull Request Checklist -1) Create yout branch from the main branch +1) Create your branch from the main branch 2) Use [Semantic Commit Messages](https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716) 3) Increase the version by using [Semantic Versioning](https://semver.org) 4) Ensure your changes are covered by tests diff --git a/LICENSE b/LICENSE index 261eeb9..e7487e6 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2023 Yuna Morgenstern Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/build.gradle.kts b/build.gradle.kts index 1af56a8..26088f1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ plugins { // Java support id("java") // Gradle IntelliJ Plugin - id("org.jetbrains.intellij") version "1.15.0" + id("org.jetbrains.intellij") version "1.16.1" // Gradle Changelog Plugin id("org.jetbrains.changelog") version "2.0.0" // Gradle Qodana Plugin diff --git a/docs/mark-outdated-actions.md b/docs/mark-outdated-actions.md new file mode 100644 index 0000000..c16fd10 --- /dev/null +++ b/docs/mark-outdated-actions.md @@ -0,0 +1,60 @@ +Mark outdated actions - plan +============================ + +## Requirement + +In a GitHub workflow, actions used can be outdated, and should be marked as such. + +## Solution + +It is possible to check what is the latest version of an action, by checking the releases on its repository. +We can analyze the workflow yaml to extract the actions used, and check whether they are outdated. +If they are outdated, we can add a comment to the workflow yaml, to mark them as outdated and suggest to update them. + +## Implementation steps + +### Daniel + +- [ ] method `String getLatestActionVersion(String actionName)` that receives an action name and returns the latest + release, make sure to cache the value for future use. (e.g., `actions/checkout` => `v3`) +- [ ] method `Boolean isActionOutdated(String actionName, String currentVersion)` that receives an action name and a + version (e.g. `actions/checkout` and `v2`) and returns whether the version is outdated or not. ( + e.g. `actions/checkout` and `v2` => `true`) +- [ ] method `Map getActions(String workflowYaml)` that receives a workflow yaml and returns the list of + actions used in it with the versions used (e.g. `actions/checkout` => `v2`) +- [ ] method `Map getOutdatedActions(String workflowYaml)` that receives a workflow yaml and returns the + list of actions used in it that are outdated with the latest version (e.g. `actions/checkout` => `v3`) + +Use GitHub graphql API to get the latest release tag of a repository: + +```graphql +query { + repository(owner:"cunla", name:"ghactions-manager") { + latestRelease { + tag { + name + } + } + } +} +``` + +Result: +```json +{ + "data": { + "repository": { + "latestRelease": { + "tag": { + "name": "v1.15.1" + } + } + } + } +} +``` + +### Yuna + +- [ ] UI to mark outdated actions and add an action comment to update to the latest versions. + diff --git a/docs/navigation.md b/docs/navigation.md new file mode 100644 index 0000000..0f25cf5 --- /dev/null +++ b/docs/navigation.md @@ -0,0 +1,92 @@ +Here is a short Navigation: + +## General: + +- Test Pipeline: Test Pipeline as the Tests itself are broken, JetBrains Test System cant work with async tasks out of + the box. +- Plugin Complexity: This i want to reduce! I am really sorry about the Plugin complexity, when i started it was much + easier but then is was also unstable as hell. + - No own objects & No Constants - I try to keep the number of own objects low, as i have seen memory leaks while + using custom objects! Looks like i always need to clean them up by myself for every Context like: open & close + Project, PsiElement… + - JetBrains does not like to have Read, Write, IO, Network traffic, Syntax Highlighting,… in the same thread. Thats + why i often need things like this: + - `ApplicationManager.getApplication().executeOnPooledThread` + - `ApplicationManager.getApplication().invokeLater` + - `ApplicationManager.getApplication().isUnitTestMode()` + - `ApplicationManager.getApplication().runReadAction` + +## Package: [Services](https://github.com/YunaBraska/github-workflow-plugin/tree/main/src/main/java/com/github/yunabraska/githubworkflow/services): + +These are the trigger and entry place to start looking at. These are the Extensions which are registered in +the [Plugin.xml](https://github.com/YunaBraska/github-workflow-plugin/blob/main/src/main/resources/META-INF/plugin.xml) + +- [CodeCompletion](https://github.com/YunaBraska/github-workflow-plugin/blob/main/src/main/java/com/github/yunabraska/githubworkflow/services/CodeCompletion.java) - + completes code. Its one of my first classes. +- [FileIconProvider](https://github.com/YunaBraska/github-workflow-plugin/blobmain/src/main/java/com/github/yunabraska/githubworkflow/services/FileIconProvider.java) - + Marks the files with an GitHub Icon +- [GitHubActionCache](https://github.com/YunaBraska/github-workflow-plugin/blob/main/src/main/java/com/github/yunabraska/githubworkflow/services/GitHubActionCache.java) - + This might be interesting for you, as this is the core logic to have a GitHub Actions and Workflow cache over all + Projects + - Careful, i did only manage to store java maps, everything else is pretty hard to `serialize` and `deserialize` + +- [HighlightAnnotator](https://github.com/YunaBraska/github-workflow-plugin/blob/main/src/main/java/com/github/yunabraska/githubworkflow/services/HighlightAnnotator.java) - + Adds Syntax Highlighting and text formats for the Reference Contributor (It receives PsiElements which are in your + View or have been changed) +- [ReferenceContributor](https://github.com/YunaBraska/github-workflow-plugin/blob/main/src/main/java/com/github/yunabraska/githubworkflow/services/ReferenceContributor.java) - + Adds References inline or external links to `Actions`, `Workflows` and now also on `Needs` (It receives + PsiElements which are in your View or have been changed) +- [PluginErrorReportSubmitter](https://github.com/YunaBraska/github-workflow-plugin/blob/main/src/main/java/com/github/yunabraska/githubworkflow/services/PluginErrorReportSubmitter.java) - + Users can submit an issue on GitHub on any Exception - _(pretty simple and clear. We don’t need actions here)_ +- [ProjectStartup](https://github.com/YunaBraska/github-workflow-plugin/blob/main/src/main/java/com/github/yunabraska/githubworkflow/services/ProjectStartup.java) - + as it already tells, its the executor on Project Startup +- [SchemaProvider](https://github.com/YunaBraska/github-workflow-plugin/blob/main/src/main/java/com/github/yunabraska/githubworkflow/services/SchemaProvider.java) - + It provides several GitHub YAML Schemas - _(pretty simple and clear. We don’t need actions here)_ + +## Package: [Logic](https://github.com/YunaBraska/github-workflow-plugin/tree/main/src/main/java/com/github/yunabraska/githubworkflow/logic): + +a doubtful attempt to move some common PsiElements extraction to named classes and hopefully get a faster overview whats +going on. + +- You will find the logic for Syntax Highlighting, Reference Contributor, Code Completion for each logical element + like `Action`, `Envs`, `GitHub`, `Inputs`, `Jobs`,… + +## Package: [Helper](https://github.com/YunaBraska/github-workflow-plugin/tree/main/src/main/java/com/github/yunabraska/githubworkflow/helper): + +Boring helper / utils classes + +- [PsiElementHelper](https://github.com/YunaBraska/github-workflow-plugin/blob/main/src/main/java/com/github/yunabraska/githubworkflow/helper/PsiElementHelper.java) - + A core logic to navigate through the PsiElements +- [GitHubWorkflowConfig](https://github.com/YunaBraska/github-workflow-plugin/blob/main/src/main/java/com/github/yunabraska/githubworkflow/helper/GitHubWorkflowConfig.java) - + A core config, mostly about the descriptions of the PsiElements + +## My next Plans: + +- Creation of a `PreProcessor` to have only one place to parse PsiElements: + - Why: + The [HighlightAnnotator](https://github.com/YunaBraska/github-workflow-plugin/blob/main/src/main/java/com/github/yunabraska/githubworkflow/services/HighlightAnnotator.java) + and [ReferenceContributor](https://github.com/YunaBraska/github-workflow-plugin/blob/main/src/main/java/com/github/yunabraska/githubworkflow/services/ReferenceContributor.java) + are doing mostly the same operations + and [CodeCompletion](https://github.com/YunaBraska/github-workflow-plugin/blob/main/src/main/java/com/github/yunabraska/githubworkflow/services/CodeCompletion.java) + is also doing partially the same things. This leads to duplicated code, complexity and context issues like i + mentioned + about same thread with different contexts (Read, Write, IO, Network traffic, Syntax Highlighting) which JetBrains + doesn’t like + - Cache: I would prefer to use the Build in cache for PsiElements + like: `PsiElement.getUserData()` & `PsiElement.putUserData()` This cache is managed by jetBrains and can + be + easily + picked up + by [HighlightAnnotator](https://github.com/YunaBraska/github-workflow-plugin/blob/main/src/main/java/com/github/yunabraska/githubworkflow/services/HighlightAnnotator.java) & [ReferenceContributor](https://github.com/YunaBraska/github-workflow-plugin/blob/main/src/main/java/com/github/yunabraska/githubworkflow/services/ReferenceContributor.java) & [CodeCompletion](https://github.com/YunaBraska/github-workflow-plugin/blob/main/src/main/java/com/github/yunabraska/githubworkflow/services/CodeCompletion.java) + - + Trigger [HighlightAnnotator](https://github.com/YunaBraska/github-workflow-plugin/blob/main/src/main/java/com/github/yunabraska/githubworkflow/services/HighlightAnnotator.java) & [ReferenceContributor](https://github.com/YunaBraska/github-workflow-plugin/blob/main/src/main/java/com/github/yunabraska/githubworkflow/services/ReferenceContributor.java): + after the `PreProcessor` is done. Currently i only know how to trigger Syntax + Highlighting: [triggerSyntaxHighlightingForActiveFiles()](https://github.com/YunaBraska/github-workflow-plugin/blob/main/src/main/java/com/github/yunabraska/githubworkflow/services/GitHubActionCache.java) + - Trigger `Preprocessor` after FileChange: this should be simple and there should be a fixed delay for e.g. 5 + seconds, + so that we are not spamming the `PreProcessor` after every typing. + + +## My Questions: +- Are you willing to migrate to Kotlin? +- Are you willing to consider diff --git a/gradle.properties b/gradle.properties index 24ad83b..1aada68 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,20 +7,20 @@ pluginRepositoryUrl = https://github.com/YunaBraska/github-workflow-plugin pluginVersion = 3.2.1 # Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html -pluginSinceBuild = 231 +pluginSinceBuild = 232 # Not specifying until-build means it will include all future builds (including unreleased IDE versions, which might impact compatibility later). #pluginUntilBuild = 231.* # IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension platformType = IC -platformVersion = 2023.1 +platformVersion = 2023.2.5 # Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html # Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22 platformPlugins = org.jetbrains.plugins.github,org.jetbrains.plugins.yaml # Gradle Releases -> https://github.com/gradle/gradle/releases -gradleVersion = 8.0.2 +gradleVersion = 8.5 # Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib # suppress inspection "UnusedProperty" diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 033e24c..c1962a7 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9f4197d..1af9e09 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/main/java/com/github/yunabraska/githubworkflow/helper/AutoPopupInsertHandler.java b/src/main/java/com/github/yunabraska/githubworkflow/helper/AutoPopupInsertHandler.java index 30b5453..68c7fa6 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/helper/AutoPopupInsertHandler.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/helper/AutoPopupInsertHandler.java @@ -10,11 +10,6 @@ public class AutoPopupInsertHandler implements InsertHandler { public static final AutoPopupInsertHandler INSTANCE = new AutoPopupInsertHandler<>(); - @Override - public void handleInsert(@NotNull final InsertionContext context, @NotNull final T item) { - AutoPopupController.getInstance(context.getProject()).autoPopupMemberLookup(context.getEditor(), null); - } - public static void addSuffix(final InsertionContext ctx, final LookupElement item, final char suffix) { if (suffix != Character.MIN_VALUE) { final String key = item.getLookupString(); @@ -65,4 +60,9 @@ private static String toInsertString(final char suffix, final CharSequence docum } return sb.toString(); } + + @Override + public void handleInsert(@NotNull final InsertionContext context, @NotNull final T item) { + AutoPopupController.getInstance(context.getProject()).autoPopupMemberLookup(context.getEditor(), null); + } } diff --git a/src/main/java/com/github/yunabraska/githubworkflow/helper/FileDownloader.java b/src/main/java/com/github/yunabraska/githubworkflow/helper/FileDownloader.java index 20e22ae..ebe69ee 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/helper/FileDownloader.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/helper/FileDownloader.java @@ -5,7 +5,6 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.ProjectManager; -import com.intellij.util.io.HttpRequests; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.plugins.github.api.GithubApiRequest; @@ -36,10 +35,10 @@ private FileDownloader() { public static String downloadFileFromGitHub(final String downloadUrl) { return GHAccountsUtil.getAccounts().stream() - .map(account -> downloadFromGitHub(downloadUrl, account)) - .filter(Objects::nonNull) - .findFirst() - .orElse(null); + .map(account -> downloadFromGitHub(downloadUrl, account)) + .filter(Objects::nonNull) + .findFirst() + .orElse(null); } @@ -56,7 +55,7 @@ public static String downloadContent(final String urlString) { return ""; } -// @Nullable + // @Nullable // public static String downloadSync(final String urlString, final String userAgent) { // try { // return HttpRequests @@ -71,47 +70,47 @@ public static String downloadContent(final String urlString) { // return null; // } // } -@Nullable -public static String downloadSync(final String urlString, final String userAgent) { - HttpURLConnection connection = null; - try { - connection = (HttpURLConnection) new URL(urlString).openConnection(); - connection.setRequestMethod("GET"); - connection.setConnectTimeout(1000); // Connect timeout - connection.setReadTimeout(1000); // Read timeout - connection.setRequestProperty("User-Agent", userAgent); - connection.setRequestProperty("Client-Name", "GitHub Workflow Plugin"); + @Nullable + public static String downloadSync(final String urlString, final String userAgent) { + HttpURLConnection connection = null; + try { + connection = (HttpURLConnection) new URL(urlString).openConnection(); + connection.setRequestMethod("GET"); + connection.setConnectTimeout(1000); // Connect timeout + connection.setReadTimeout(1000); // Read timeout + connection.setRequestProperty("User-Agent", userAgent); + connection.setRequestProperty("Client-Name", "GitHub Workflow Plugin"); - // Check for successful response code or throw error - if (connection.getResponseCode() / 100 != 2) { - throw new IOException("HTTP error code: " + connection.getResponseCode()); - } + // Check for successful response code or throw error + if (connection.getResponseCode() / 100 != 2) { + throw new IOException("HTTP error code: " + connection.getResponseCode()); + } - // Read response - try (final BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()))) { - final StringBuilder response = new StringBuilder(); - String inputLine; - while ((inputLine = in.readLine()) != null) { - response.append(inputLine).append(System.lineSeparator()); + // Read response + try (final BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()))) { + final StringBuilder response = new StringBuilder(); + String inputLine; + while ((inputLine = in.readLine()) != null) { + response.append(inputLine).append(System.lineSeparator()); + } + return response.toString(); + } + } catch (final Exception e) { + // Handle exceptions accordingly, returning null is often not a good practice + return null; + } finally { + if (connection != null) { + connection.disconnect(); } - return response.toString(); - } - } catch (final Exception e) { - // Handle exceptions accordingly, returning null is often not a good practice - return null; - } finally { - if (connection != null) { - connection.disconnect(); } } -} private static String downloadFromGitHub(final String downloadUrl, final GithubAccount account) { return ofNullable(ProjectUtil.getActiveProject()) - .or(() -> Optional.of(ProjectManager.getInstance().getDefaultProject())) - .map(project -> GHCompatibilityUtil.getOrRequestToken(account, project)) - .map(token -> downloadContent(downloadUrl, token)) - .orElse(null); + .or(() -> Optional.of(ProjectManager.getInstance().getDefaultProject())) + .map(project -> GHCompatibilityUtil.getOrRequestToken(account, project)) + .map(token -> downloadContent(downloadUrl, token)) + .orElse(null); } private static String downloadContent(final String downloadUrl, final String token) { diff --git a/src/main/java/com/github/yunabraska/githubworkflow/helper/GitHubWorkflowConfig.java b/src/main/java/com/github/yunabraska/githubworkflow/helper/GitHubWorkflowConfig.java index 664881f..1ff8d9a 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/helper/GitHubWorkflowConfig.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/helper/GitHubWorkflowConfig.java @@ -1,9 +1,7 @@ package com.github.yunabraska.githubworkflow.helper; -import java.util.HashMap; import java.util.Map; -import java.util.function.Supplier; import java.util.regex.Pattern; @SuppressWarnings("java:S2386") @@ -26,140 +24,120 @@ public class GitHubWorkflowConfig { public static final String FIELD_STEPS = "steps"; public static final String FIELD_RUNNER = "runner"; public static final String FIELD_GITHUB = "github"; - public static final String FIELD_DEFAULT = "${{}}"; public static final String FIELD_INPUTS = "inputs"; public static final String FIELD_OUTPUTS = "outputs"; public static final String FIELD_SECRETS = "secrets"; public static final String FIELD_CONCLUSION = "conclusion"; public static final String FIELD_OUTCOME = "outcome"; - public static final Map>> DEFAULT_VALUE_MAP = initProcessorMap(); - - private static Map>> initProcessorMap() { - final Map>> result = new HashMap<>(); - result.put(FIELD_GITHUB, GitHubWorkflowConfig::getGitHubContextEnvs); - result.put(FIELD_ENVS, GitHubWorkflowConfig::getGitHubEnvs); - result.put(FIELD_RUNNER, GitHubWorkflowConfig::getRunnerItems); - result.put(FIELD_DEFAULT, GitHubWorkflowConfig::getCaretBracketItems); - return result; - } - - private static HashMap getRunnerItems() { - final HashMap result = new HashMap<>(); - result.put("name", "The name of the runner executing the job."); - result.put("os", "The operating system of the runner executing the job. Possible values are Linux, Windows, or macOS."); - result.put("arch", "The architecture of the runner executing the job. Possible values are X86, X64, ARM, or ARM64."); - result.put("temp", "The path to a temporary directory on the runner. This directory is emptied at the beginning and end of each job. Note that files will not be removed if the runner's user account does not have permission to delete them."); - result.put("tool_cache", "he path to the directory containing preinstalled tools for GitHub-hosted runners. For more information, see \"About GitHub-hosted runners\"."); - result.put("debug", "The path to the directory containing preinstalled tools for GitHub-hosted runners. For more information, see \"About GitHub-hosted runners\"."); - return result; - } - - private static HashMap getCaretBracketItems() { - final HashMap result = new HashMap<>(); - result.put(FIELD_INPUTS, "Workflow inputs e.g. from workflow_dispatch, workflow_call"); - result.put(FIELD_SECRETS, "Workflow secrets"); - result.put(FIELD_JOBS, "Workflow jobs"); - result.put(FIELD_STEPS, "steps with 'id' of the current job"); - result.put(FIELD_ENVS, "Environment variables from jobs amd steps"); - result.put(FIELD_VARS, "The vars context contains custom configuration variables set at the organization, repository, and environment levels. For more information about defining configuration variables for use in multiple workflows"); - result.put(FIELD_NEEDS, "Identifies any jobs that must complete successfully before this job will run. It can be a string or array of strings. If a job fails, all jobs that need it are skipped unless the jobs use a conditional statement that causes the job to continue."); - result.put(FIELD_GITHUB, "Information about the workflow run and the event that triggered the run. You can also read most of the github context data in environment variables. For more information about environment variables"); - return result; - } //TODO: autogenerate this //https://docs.github.com/en/actions/learn-github-actions/contexts#github-context - private static HashMap getGitHubContextEnvs() { - final HashMap result = new HashMap<>(); - result.put("action", "The name of the action currently running, or the id of a step. GitHub removes special characters, and uses the name __run when the current step runs a script without an id. If you use the same action more than once in the same job, the name will include a suffix with the sequence number with underscore before it. For example, the first script you run will have the name __run, and the second script will be named __run_2. Similarly, the second invocation of actions/checkout will be actionscheckout2."); - result.put("action_path", "The path where an action is located. This property is only supported in composite actions. You can use this path to access files located in the same repository as the action, for example by changing directories to the path: cd ${{ github.action_path }} ."); - result.put("action_ref", "For a step executing an action, this is the ref of the action being executed. For example, v2."); - result.put("action_repository", "For a step executing an action, this is the owner and repository name of the action. For example, actions/checkout."); - result.put("action_status", "For a composite action, the current result of the composite action."); - result.put("actor", "The username of the user that triggered the initial workflow run. If the workflow run is a re-run, this value may differ from github.triggering_actor. Any workflow re-runs will use the privileges of github.actor, even if the actor initiating the re-run (github.triggering_actor) has different privileges."); - result.put("actor_id", "The account ID of the person or app that triggered the initial workflow run. For example, 1234567. Note that this is different from the actor username."); - result.put("api_url", "The URL of the GitHub REST API."); - result.put("base_ref", "The base_ref or target branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is either pull_request or pull_request_target."); - result.put("env", "Path on the runner to the file that sets environment variables from workflow commands. This file is unique to the current step and is a different file for each step in a job. For more information, see \"Workflow commands for GitHub Actions.\""); - result.put("event", "The full event webhook payload. You can access individual properties of the event using this context. This object is identical to the webhook payload of the event that triggered the workflow run, and is different for each event. The webhooks for each GitHub Actions event is linked in \"Events that trigger workflows.\" For example, for a workflow run triggered by the push event, this object contains the contents of the push webhook payload."); - result.put("event_name", "The name of the event that triggered the workflow run."); - result.put("event_path", "The path to the file on the runner that contains the full event webhook payload."); - result.put("graphql_url", "The URL of the GitHub GraphQL API."); - result.put("head_ref", "The head_ref or source branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is either pull_request or pull_request_target."); - result.put("job", "The job_id of the current job. \nNote: This context property is set by the Actions runner, and is only available within the execution steps of a job. Otherwise, the value of this property will be null."); - result.put("job_workflow_sha", "For jobs using a reusable workflow, the commit SHA for the reusable workflow file."); - result.put("path", "Path on the runner to the file that sets system PATH variables from workflow commands. This file is unique to the current step and is a different file for each step in a job. For more information, see \"Workflow commands for GitHub Actions.\""); - result.put("ref", "The fully-formed ref of the branch or tag that triggered the workflow run. For workflows triggered by push, this is the branch or tag ref that was pushed. For workflows triggered by pull_request, this is the pull request merge branch. For workflows triggered by release, this is the release tag created. For other triggers, this is the branch or tag ref that triggered the workflow run. This is only set if a branch or tag is available for the event type. The ref given is fully-formed, meaning that for branches the format is refs/heads/, for pull requests it is refs/pull//merge, and for tags it is refs/tags/. For example, refs/heads/feature-branch-1."); - result.put("ref_name", "The short ref name of the branch or tag that triggered the workflow run. This value matches the branch or tag name shown on GitHub. For example, feature-branch-1."); - result.put("ref_protected", "true if branch protections are configured for the ref that triggered the workflow run."); - result.put("ref_type", "The type of ref that triggered the workflow run. Valid values are branch or tag."); - result.put("repository", "The owner and repository name. For example, octocat/Hello-World."); - result.put("repository_id", "The ID of the repository. For example, 123456789. Note that this is different from the repository name."); - result.put("repository_owner", "The repository owner's username. For example, octocat."); - result.put("repository_owner_id", "The repository owner's account ID. For example, 1234567. Note that this is different from the owner's name."); - result.put("repositoryUrl", "The Git URL to the repository. For example, git://github.com/octocat/hello-world.git."); - result.put("retention_days", "The number of days that workflow run logs and artifacts are kept."); - result.put("run_id", "A unique number for each workflow run within a repository. This number does not change if you re-run the workflow run."); - result.put("run_number", "A unique number for each run of a particular workflow in a repository. This number begins at 1 for the workflow's first run, and increments with each new run. This number does not change if you re-run the workflow run."); - result.put("run_attempt", "A unique number for each attempt of a particular workflow run in a repository. This number begins at 1 for the workflow run's first attempt, and increments with each re-run."); - result.put("secret_source", "The source of a secret used in a workflow. Possible values are None, Actions, Dependabot, or Codespaces."); - result.put("server_url", "The URL of the GitHub server. For example: https://github.com."); - result.put("sha", "The commit SHA that triggered the workflow. The value of this commit SHA depends on the event that triggered the workflow. For more information, see \"Events that trigger workflows.\" For example, ffac537e6cbbf934b08745a378932722df287a53."); - result.put("token", "A token to authenticate on behalf of the GitHub App installed on your repository. This is functionally equivalent to the GITHUB_TOKEN secret. For more information, see \"Automatic token authentication.\" \nNote: This context property is set by the Actions runner, and is only available within the execution steps of a job. Otherwise, the value of this property will be null."); - result.put("triggering_actor", "The username of the user that initiated the workflow run. If the workflow run is a re-run, this value may differ from github.actor. Any workflow re-runs will use the privileges of github.actor, even if the actor initiating the re-run (github.triggering_actor) has different privileges."); - result.put("workflow", "The name of the workflow. If the workflow file doesn't specify a name, the value of this property is the full path of the workflow file in the repository."); - result.put("workflow_ref", "The ref path to the workflow. For example, octocat/hello-world/.github/workflows/my-workflow.yml@refs/heads/my_branch."); - result.put("workflow_sha", "The commit SHA for the workflow file."); - result.put("workspace", "The default working directory on the runner for steps, and the default location of your repository when using the checkout action."); - return result; - } - + public static final Map FIELD_GITHUB_MAP = Map.ofEntries( + Map.entry("action", "The name of the action currently running, or the id of a step. GitHub removes special characters, and uses the name __run when the current step runs a script without an id. If you use the same action more than once in the same job, the name will include a suffix with the sequence number with underscore before it. For example, the first script you run will have the name __run, and the second script will be named __run_2. Similarly, the second invocation of actions/checkout will be actionscheckout2."), + Map.entry("action_path", "The path where an action is located. This property is only supported in composite actions. You can use this path to access files located in the same repository as the action, for example by changing directories to the path: cd ${{ github.action_path }} ."), + Map.entry("action_ref", "For a step executing an action, this is the ref of the action being executed. For example, v2."), + Map.entry("action_repository", "For a step executing an action, this is the owner and repository name of the action. For example, actions/checkout."), + Map.entry("action_status", "For a composite action, the current result of the composite action."), + Map.entry("actor", "The username of the user that triggered the initial workflow run. If the workflow run is a re-run, this value may differ from github.triggering_actor. Any workflow re-runs will use the privileges of github.actor, even if the actor initiating the re-run (github.triggering_actor) has different privileges."), + Map.entry("actor_id", "The account ID of the person or app that triggered the initial workflow run. For example, 1234567. Note that this is different from the actor username."), + Map.entry("api_url", "The URL of the GitHub REST API."), + Map.entry("base_ref", "The base_ref or target branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is either pull_request or pull_request_target."), + Map.entry("env", "Path on the runner to the file that sets environment variables from workflow commands. This file is unique to the current step and is a different file for each step in a job. For more information, see \"Workflow commands for GitHub Actions.\""), + Map.entry("event", "The full event webhook payload. You can access individual properties of the event using this context. This object is identical to the webhook payload of the event that triggered the workflow run, and is different for each event. The webhooks for each GitHub Actions event is linked in \"Events that trigger workflows.\" For example, for a workflow run triggered by the push event, this object contains the contents of the push webhook payload."), + Map.entry("event_name", "The name of the event that triggered the workflow run."), + Map.entry("event_path", "The path to the file on the runner that contains the full event webhook payload."), + Map.entry("graphql_url", "The URL of the GitHub GraphQL API."), + Map.entry("head_ref", "The head_ref or source branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is either pull_request or pull_request_target."), + Map.entry("job", "The job_id of the current job. \nNote: This context property is set by the Actions runner, and is only available within the execution steps of a job. Otherwise, the value of this property will be null."), + Map.entry("job_workflow_sha", "For jobs using a reusable workflow, the commit SHA for the reusable workflow file."), + Map.entry("path", "Path on the runner to the file that sets system PATH variables from workflow commands. This file is unique to the current step and is a different file for each step in a job. For more information, see \"Workflow commands for GitHub Actions.\""), + Map.entry("ref", "The fully-formed ref of the branch or tag that triggered the workflow run. For workflows triggered by push, this is the branch or tag ref that was pushed. For workflows triggered by pull_request, this is the pull request merge branch. For workflows triggered by release, this is the release tag created. For other triggers, this is the branch or tag ref that triggered the workflow run. This is only set if a branch or tag is available for the event type. The ref given is fully-formed, meaning that for branches the format is refs/heads/, for pull requests it is refs/pull//merge, and for tags it is refs/tags/. For example, refs/heads/feature-branch-1."), + Map.entry("ref_name", "The short ref name of the branch or tag that triggered the workflow run. This value matches the branch or tag name shown on GitHub. For example, feature-branch-1."), + Map.entry("ref_protected", "true if branch protections are configured for the ref that triggered the workflow run."), + Map.entry("ref_type", "The type of ref that triggered the workflow run. Valid values are branch or tag."), + Map.entry("repository", "The owner and repository name. For example, octocat/Hello-World."), + Map.entry("repository_id", "The ID of the repository. For example, 123456789. Note that this is different from the repository name."), + Map.entry("repository_owner", "The repository owner's username. For example, octocat."), + Map.entry("repository_owner_id", "The repository owner's account ID. For example, 1234567. Note that this is different from the owner's name."), + Map.entry("repositoryUrl", "The Git URL to the repository. For example, git://github.com/octocat/hello-world.git."), + Map.entry("retention_days", "The number of days that workflow run logs and artifacts are kept."), + Map.entry("run_id", "A unique number for each workflow run within a repository. This number does not change if you re-run the workflow run."), + Map.entry("run_number", "A unique number for each run of a particular workflow in a repository. This number begins at 1 for the workflow's first run, and increments with each new run. This number does not change if you re-run the workflow run."), + Map.entry("run_attempt", "A unique number for each attempt of a particular workflow run in a repository. This number begins at 1 for the workflow run's first attempt, and increments with each re-run."), + Map.entry("secret_source", "The source of a secret used in a workflow. Possible values are None, Actions, Dependabot, or Codespaces."), + Map.entry("server_url", "The URL of the GitHub server. For example: https://github.com."), + Map.entry("sha", "The commit SHA that triggered the workflow. The value of this commit SHA depends on the event that triggered the workflow. For more information, see \"Events that trigger workflows.\" For example, ffac537e6cbbf934b08745a378932722df287a53."), + Map.entry("token", "A token to authenticate on behalf of the GitHub App installed on your repository. This is functionally equivalent to the GITHUB_TOKEN secret. For more information, see \"Automatic token authentication.\" \nNote: This context property is set by the Actions runner, and is only available within the execution steps of a job. Otherwise, the value of this property will be null."), + Map.entry("triggering_actor", "The username of the user that initiated the workflow run. If the workflow run is a re-run, this value may differ from github.actor. Any workflow re-runs will use the privileges of github.actor, even if the actor initiating the re-run (github.triggering_actor) has different privileges."), + Map.entry("workflow", "The name of the workflow. If the workflow file doesn't specify a name, the value of this property is the full path of the workflow file in the repository."), + Map.entry("workflow_ref", "The ref path to the workflow. For example, octocat/hello-world/.github/workflows/my-workflow.yml@refs/heads/my_branch."), + Map.entry("workflow_sha", "The commit SHA for the workflow file."), + Map.entry("workspace", "The default working directory on the runner for steps, and the default location of your repository when using the checkout action.") + ); //TODO: autogenerate this //https://docs.github.com/en/actions/learn-github-actions/variables#using-the-vars-context-to-access-configuration-variable-values - private static HashMap getGitHubEnvs() { - final HashMap result = new HashMap<>(); - result.put("CI", "Always set to true."); - result.put("GITHUB_ACTION", "The name of the action currently running, or the id of a step. For example, for an action, __repo-owner_name-of-action-repo.\n\nGitHub removes special characters, and uses the name __run when the current step runs a script without an id. If you use the same script or action more than once in the same job, the name will include a suffix that consists of the sequence number preceded by an underscore. For example, the first script you run will have the name __run, and the second script will be named __run_2. Similarly, the second invocation of actions/checkout will be actionscheckout2."); - result.put("GITHUB_ACTION_PATH", "The path where an action is located. This property is only supported in composite actions. You can use this path to access files located in the same repository as the action. For example, /home/runner/work/_actions/repo-owner/name-of-action-repo/v1."); - result.put("GITHUB_ACTION_REPOSITORY", "For a step executing an action, this is the owner and repository name of the action. For example, actions/checkout."); - result.put("GITHUB_ACTIONS", "Always set to true when GitHub Actions is running the workflow. You can use this variable to differentiate when tests are being run locally or by GitHub Actions."); - result.put("GITHUB_ACTOR", "The name of the person or app that initiated the workflow. For example, octocat."); - result.put("GITHUB_ACTOR_ID", "The account ID of the person or app that triggered the initial workflow run. For example, 1234567. Note that this is different from the actor username."); - result.put("GITHUB_API_URL", "Returns the API URL. For example: https://api.github.com."); - result.put("GITHUB_BASE_REF", "The name of the base ref or target branch of the pull request in a workflow run. This is only set when the event that triggers a workflow run is either pull_request or pull_request_target. For example, main."); - result.put("GITHUB_ENV", "The path on the runner to the file that sets variables from workflow commands. This file is unique to the current step and changes for each step in a job. For example, /home/runner/work/_temp/_runner_file_commands/set_env_87406d6e-4979-4d42-98e1-3dab1f48b13a. For more information, see \"Workflow commands for GitHub Actions.\""); - result.put("GITHUB_EVENT_NAME", "The name of the event that triggered the workflow. For example, workflow_dispatch."); - result.put("GITHUB_EVENT_PATH", "The path to the file on the runner that contains the full event webhook payload. For example, /github/workflow/event.json."); - result.put("GITHUB_GRAPHQL_URL", "Returns the GraphQL API URL. For example: https://api.github.com/graphql"); - result.put("GITHUB_HEAD_REF", "The head ref or source branch of the pull request in a workflow run. This property is only set when the event that triggers a workflow run is either pull_request or pull_request_target. For example, feature-branch-1."); - result.put("GITHUB_JOB", "The job_id of the current job. For example, greeting_job."); - result.put("GITHUB_PATH", "The path on the runner to the file that sets system PATH variables from workflow commands. This file is unique to the current step and changes for each step in a job. For example, /home/runner/work/_temp/_runner_file_commands/add_path_899b9445-ad4a-400c-aa89-249f18632cf5. For more information, see \"Workflow commands for GitHub Actions.\""); - result.put("GITHUB_REF", "The fully-formed ref of the branch or tag that triggered the workflow run. For workflows triggered by push, this is the branch or tag ref that was pushed. For workflows triggered by pull_request, this is the pull request merge branch. For workflows triggered by release, this is the release tag created. For other triggers, this is the branch or tag ref that triggered the workflow run. This is only set if a branch or tag is available for the event type. The ref given is fully-formed, meaning that for branches the format is refs/heads/, for pull requests it is refs/pull//merge, and for tags it is refs/tags/. For example, refs/heads/feature-branch-1."); - result.put("GITHUB_REF_NAME", "The short ref name of the branch or tag that triggered the workflow run. This value matches the branch or tag name shown on GitHub. For example, feature-branch-1."); - result.put("GITHUB_REF_PROTECTED", "true if branch protections are configured for the ref that triggered the workflow run."); - result.put("GITHUB_REF_TYPE", "The type of ref that triggered the workflow run. Valid values are branch or tag."); - result.put("GITHUB_REPOSITORY", "The owner and repository name. For example, octocat/Hello-World."); - result.put("GITHUB_REPOSITORY_ID", "The ID of the repository. For example, 123456789. Note that this is different from the repository name."); - result.put("GITHUB_REPOSITORY_OWNER", "The repository owner's account ID. For example, 1234567. Note that this is different from the owner's name."); - result.put("GITHUB_RETENTION_DAYS", "The number of days that workflow run logs and artifacts are kept. For example, 90."); - result.put("GITHUB_RUN_ATTEMPT", "A unique number for each attempt of a particular workflow run in a repository. This number begins at 1 for the workflow run's first attempt, and increments with each re-run. For example, 3."); - result.put("GITHUB_RUN_ID", "A unique number for each workflow run within a repository. This number does not change if you re-run the workflow run. For example, 1658821493."); - result.put("GITHUB_RUN_NUMBER", "A unique number for each run of a particular workflow in a repository. This number begins at 1 for the workflow's first run, and increments with each new run. This number does not change if you re-run the workflow run. For example, 3."); - result.put("GITHUB_SERVER_URL", "The URL of the GitHub server. For example: https://github.com."); - result.put("GITHUB_SHA", "The commit SHA that triggered the workflow. The value of this commit SHA depends on the event that triggered the workflow. For more information, see \"Events that trigger workflows.\" For example, ffac537e6cbbf934b08745a378932722df287a53."); - result.put("GITHUB_STEP_SUMMARY", "The path on the runner to the file that contains job summaries from workflow commands. This file is unique to the current step and changes for each step in a job. For example, /home/runner/_layout/_work/_temp/_runner_file_commands/step_summary_1cb22d7f-5663-41a8-9ffc-13472605c76c. For more information, see \"Workflow commands for GitHub Actions.\""); - result.put("GITHUB_WORKFLOW", "The name of the workflow. For example, My test workflow. If the workflow file doesn't specify a name, the value of this variable is the full path of the workflow file in the repository."); - result.put("GITHUB_WORKFLOW_REF", "The ref path to the workflow. For example, octocat/hello-world/.github/workflows/my-workflow.yml@refs/heads/my_branch."); - result.put("GITHUB_WORKFLOW_SHA", "The commit SHA for the workflow file."); - result.put("GITHUB_WORKSPACE", "The default working directory on the runner for steps, and the default location of your repository when using the checkout action. For example, /home/runner/work/my-repo-name/my-repo-name."); - result.put("RUNNER_ARCH", "The architecture of the runner executing the job. Possible values are X86, X64, ARM, or ARM64."); - result.put("RUNNER_DEBUG", "This is set only if debug logging is enabled, and always has the value of 1. It can be useful as an indicator to enable additional debugging or verbose logging in your own job steps."); - result.put("RUNNER_NAME", "The name of the runner executing the job. For example, Hosted Agent"); - result.put("RUNNER_OS", "The operating system of the runner executing the job. Possible values are Linux, Windows, or macOS. For example, Windows"); - result.put("RUNNER_TEMP", "The path to a temporary directory on the runner. This directory is emptied at the beginning and end of each job. Note that files will not be removed if the runner's user account does not have permission to delete them. For example, D:\\a\\_temp"); - result.put("RUNNER_TOOL_CACHE", "The path to the directory containing preinstalled tools for GitHub-hosted runners. For more information, see \"About GitHub-hosted runners\". For example, C:\\hostedtoolcache\\windows"); - return result; - } + public static final Map FIELD_ENVS_MAP = Map.ofEntries( + Map.entry("CI", "Always set to true."), + Map.entry("GITHUB_ACTION", "The name of the action currently running, or the id of a step. For example, for an action, __repo-owner_name-of-action-repo.\n\nGitHub removes special characters, and uses the name __run when the current step runs a script without an id. If you use the same script or action more than once in the same job, the name will include a suffix that consists of the sequence number preceded by an underscore. For example, the first script you run will have the name __run, and the second script will be named __run_2. Similarly, the second invocation of actions/checkout will be actionscheckout2."), + Map.entry("GITHUB_ACTION_PATH", "The path where an action is located. This property is only supported in composite actions. You can use this path to access files located in the same repository as the action. For example, /home/runner/work/_actions/repo-owner/name-of-action-repo/v1."), + Map.entry("GITHUB_ACTION_REPOSITORY", "For a step executing an action, this is the owner and repository name of the action. For example, actions/checkout."), + Map.entry("GITHUB_ACTIONS", "Always set to true when GitHub Actions is running the workflow. You can use this variable to differentiate when tests are being run locally or by GitHub Actions."), + Map.entry("GITHUB_ACTOR", "The name of the person or app that initiated the workflow. For example, octocat."), + Map.entry("GITHUB_ACTOR_ID", "The account ID of the person or app that triggered the initial workflow run. For example, 1234567. Note that this is different from the actor username."), + Map.entry("GITHUB_API_URL", "Returns the API URL. For example: https://api.github.com."), + Map.entry("GITHUB_BASE_REF", "The name of the base ref or target branch of the pull request in a workflow run. This is only set when the event that triggers a workflow run is either pull_request or pull_request_target. For example, main."), + Map.entry("GITHUB_ENV", "The path on the runner to the file that sets variables from workflow commands. This file is unique to the current step and changes for each step in a job. For example, /home/runner/work/_temp/_runner_file_commands/set_env_87406d6e-4979-4d42-98e1-3dab1f48b13a. For more information, see \"Workflow commands for GitHub Actions.\""), + Map.entry("GITHUB_EVENT_NAME", "The name of the event that triggered the workflow. For example, workflow_dispatch."), + Map.entry("GITHUB_EVENT_PATH", "The path to the file on the runner that contains the full event webhook payload. For example, /github/workflow/event.json."), + Map.entry("GITHUB_GRAPHQL_URL", "Returns the GraphQL API URL. For example: https://api.github.com/graphql"), + Map.entry("GITHUB_HEAD_REF", "The head ref or source branch of the pull request in a workflow run. This property is only set when the event that triggers a workflow run is either pull_request or pull_request_target. For example, feature-branch-1."), + Map.entry("GITHUB_JOB", "The job_id of the current job. For example, greeting_job."), + Map.entry("GITHUB_PATH", "The path on the runner to the file that sets system PATH variables from workflow commands. This file is unique to the current step and changes for each step in a job. For example, /home/runner/work/_temp/_runner_file_commands/add_path_899b9445-ad4a-400c-aa89-249f18632cf5. For more information, see \"Workflow commands for GitHub Actions.\""), + Map.entry("GITHUB_REF", "The fully-formed ref of the branch or tag that triggered the workflow run. For workflows triggered by push, this is the branch or tag ref that was pushed. For workflows triggered by pull_request, this is the pull request merge branch. For workflows triggered by release, this is the release tag created. For other triggers, this is the branch or tag ref that triggered the workflow run. This is only set if a branch or tag is available for the event type. The ref given is fully-formed, meaning that for branches the format is refs/heads/, for pull requests it is refs/pull//merge, and for tags it is refs/tags/. For example, refs/heads/feature-branch-1."), + Map.entry("GITHUB_REF_NAME", "The short ref name of the branch or tag that triggered the workflow run. This value matches the branch or tag name shown on GitHub. For example, feature-branch-1."), + Map.entry("GITHUB_REF_PROTECTED", "true if branch protections are configured for the ref that triggered the workflow run."), + Map.entry("GITHUB_REF_TYPE", "The type of ref that triggered the workflow run. Valid values are branch or tag."), + Map.entry("GITHUB_REPOSITORY", "The owner and repository name. For example, octocat/Hello-World."), + Map.entry("GITHUB_REPOSITORY_ID", "The ID of the repository. For example, 123456789. Note that this is different from the repository name."), + Map.entry("GITHUB_REPOSITORY_OWNER", "The repository owner's account ID. For example, 1234567. Note that this is different from the owner's name."), + Map.entry("GITHUB_RETENTION_DAYS", "The number of days that workflow run logs and artifacts are kept. For example, 90."), + Map.entry("GITHUB_RUN_ATTEMPT", "A unique number for each attempt of a particular workflow run in a repository. This number begins at 1 for the workflow run's first attempt, and increments with each re-run. For example, 3."), + Map.entry("GITHUB_RUN_ID", "A unique number for each workflow run within a repository. This number does not change if you re-run the workflow run. For example, 1658821493."), + Map.entry("GITHUB_RUN_NUMBER", "A unique number for each run of a particular workflow in a repository. This number begins at 1 for the workflow's first run, and increments with each new run. This number does not change if you re-run the workflow run. For example, 3."), + Map.entry("GITHUB_SERVER_URL", "The URL of the GitHub server. For example: https://github.com."), + Map.entry("GITHUB_SHA", "The commit SHA that triggered the workflow. The value of this commit SHA depends on the event that triggered the workflow. For more information, see \"Events that trigger workflows.\" For example, ffac537e6cbbf934b08745a378932722df287a53."), + Map.entry("GITHUB_STEP_SUMMARY", "The path on the runner to the file that contains job summaries from workflow commands. This file is unique to the current step and changes for each step in a job. For example, /home/runner/_layout/_work/_temp/_runner_file_commands/step_summary_1cb22d7f-5663-41a8-9ffc-13472605c76c. For more information, see \"Workflow commands for GitHub Actions.\""), + Map.entry("GITHUB_WORKFLOW", "The name of the workflow. For example, My test workflow. If the workflow file doesn't specify a name, the value of this variable is the full path of the workflow file in the repository."), + Map.entry("GITHUB_WORKFLOW_REF", "The ref path to the workflow. For example, octocat/hello-world/.github/workflows/my-workflow.yml@refs/heads/my_branch."), + Map.entry("GITHUB_WORKFLOW_SHA", "The commit SHA for the workflow file."), + Map.entry("GITHUB_WORKSPACE", "The default working directory on the runner for steps, and the default location of your repository when using the checkout action. For example, /home/runner/work/my-repo-name/my-repo-name."), + Map.entry("RUNNER_ARCH", "The architecture of the runner executing the job. Possible values are X86, X64, ARM, or ARM64."), + Map.entry("RUNNER_DEBUG", "This is set only if debug logging is enabled, and always has the value of 1. It can be useful as an indicator to enable additional debugging or verbose logging in your own job steps."), + Map.entry("RUNNER_NAME", "The name of the runner executing the job. For example, Hosted Agent"), + Map.entry("RUNNER_OS", "The operating system of the runner executing the job. Possible values are Linux, Windows, or macOS. For example, Windows"), + Map.entry("RUNNER_TEMP", "The path to a temporary directory on the runner. This directory is emptied at the beginning and end of each job. Note that files will not be removed if the runner's user account does not have permission to delete them. For example, D:\\a\\_temp"), + Map.entry("RUNNER_TOOL_CACHE", "The path to the directory containing preinstalled tools for GitHub-hosted runners. For more information, see \"About GitHub-hosted runners\". For example, C:\\hostedtoolcache\\windows") + ); + + public static final Map FIELD_RUNNER_MAP = Map.of( + "name", "The name of the runner executing the job.", + "os", "The operating system of the runner executing the job. Possible values are Linux, Windows, or macOS.", + "arch", "The architecture of the runner executing the job. Possible values are X86, X64, ARM, or ARM64.", + "temp", "The path to a temporary directory on the runner. This directory is emptied at the beginning and end of each job. Note that files will not be removed if the runner's user account does not have permission to delete them.", + "tool_cache", "he path to the directory containing preinstalled tools for GitHub-hosted runners. For more information, see \"About GitHub-hosted runners\".", + "debug", "The path to the directory containing preinstalled tools for GitHub-hosted runners. For more information, see \"About GitHub-hosted runners\"." + ); + public static final Map FIELD_DEFAULT_MAP = Map.of( + FIELD_INPUTS, "Workflow inputs e.g. from workflow_dispatch, workflow_call", + FIELD_SECRETS, "Workflow secrets", + FIELD_JOBS, "Workflow jobs", + FIELD_STEPS, "steps with 'id' of the current job", + FIELD_ENVS, "Environment variables from jobs amd steps", + FIELD_VARS, "The vars context contains custom configuration variables set at the organization, repository, and environment levels. For more information about defining configuration variables for use in multiple workflows", + FIELD_NEEDS, "Identifies any jobs that must complete successfully before this job will run. It can be a string or array of strings. If a job fails, all jobs that need it are skipped unless the jobs use a conditional statement that causes the job to continue.", + FIELD_GITHUB, "Information about the workflow run and the event that triggered the run. You can also read most of the github context data in environment variables. For more information about environment variables" + ); + private GitHubWorkflowConfig() { } diff --git a/src/main/java/com/github/yunabraska/githubworkflow/helper/GitHubWorkflowHelper.java b/src/main/java/com/github/yunabraska/githubworkflow/helper/GitHubWorkflowHelper.java index cafbdaf..2ce357e 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/helper/GitHubWorkflowHelper.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/helper/GitHubWorkflowHelper.java @@ -89,23 +89,23 @@ private static boolean isInBrackets(final String partString, final int bracketSt public static LookupElement toLookupElement(final NodeIcon icon, final char suffix, final String key, final String text) { final LookupElementBuilder result = LookupElementBuilder - .create(key) - .withIcon(icon.icon()) - .withBoldness(icon != NodeIcon.ICON_ENV) - .withTypeText(text) - .withCaseSensitivity(false) - .withInsertHandler((ctx, item) -> addSuffix(ctx, item, suffix)); + .create(key) + .withIcon(icon.icon()) + .withBoldness(icon != NodeIcon.ICON_ENV) + .withTypeText(text) + .withCaseSensitivity(false) + .withInsertHandler((ctx, item) -> addSuffix(ctx, item, suffix)); return PrioritizedLookupElement.withPriority(result, icon.ordinal() + 5d); } public static Optional getWorkflowFile(final PsiElement psiElement) { return Optional.ofNullable(psiElement) - .map(PsiElement::getContainingFile) - .map(PsiFile::getOriginalFile) - .map(PsiFile::getViewProvider) - .map(FileViewProvider::getVirtualFile) - .flatMap(PsiElementHelper::toPath) - .filter(GitHubWorkflowHelper::isWorkflowPath); + .map(PsiElement::getContainingFile) + .map(PsiFile::getOriginalFile) + .map(PsiFile::getViewProvider) + .map(FileViewProvider::getVirtualFile) + .flatMap(PsiElementHelper::toPath) + .filter(GitHubWorkflowHelper::isWorkflowPath); } public static boolean isWorkflowPath(final Path path) { @@ -118,57 +118,57 @@ public static boolean isYamlFile(final Path path) { public static boolean isActionFile(final Path path) { return path.getNameCount() > 1 - && (path.getName(path.getNameCount() - 1).toString().equalsIgnoreCase("action.yml") - || path.getName(path.getNameCount() - 1).toString().equalsIgnoreCase("action.yaml")); + && (path.getName(path.getNameCount() - 1).toString().equalsIgnoreCase("action.yml") + || path.getName(path.getNameCount() - 1).toString().equalsIgnoreCase("action.yaml")); } public static boolean isWorkflowFile(final Path path) { return path != null && path.getNameCount() > 2 - && isYamlFile(path) - && path.getName(path.getNameCount() - 2).toString().equalsIgnoreCase("workflows") - && path.getName(path.getNameCount() - 3).toString().equalsIgnoreCase(".github"); + && isYamlFile(path) + && path.getName(path.getNameCount() - 2).toString().equalsIgnoreCase("workflows") + && path.getName(path.getNameCount() - 3).toString().equalsIgnoreCase(".github"); } public static boolean isWorkflowTemplatePropertiesFile(final Path path) { return path.getNameCount() > 2 - && path.getName(path.getNameCount() - 3).toString().equalsIgnoreCase(".github") - && path.getName(path.getNameCount() - 2).toString().equalsIgnoreCase("workflow-templates") - && isYamlFile(path); + && path.getName(path.getNameCount() - 3).toString().equalsIgnoreCase(".github") + && path.getName(path.getNameCount() - 2).toString().equalsIgnoreCase("workflow-templates") + && isYamlFile(path); } public static boolean isIssueForms(final Path path) { return path.getNameCount() > 2 - && path.getName(path.getNameCount() - 3).toString().equalsIgnoreCase(".github") - && path.getName(path.getNameCount() - 2).toString().equalsIgnoreCase("ISSUE_TEMPLATE") - && isYamlFile(path); + && path.getName(path.getNameCount() - 3).toString().equalsIgnoreCase(".github") + && path.getName(path.getNameCount() - 2).toString().equalsIgnoreCase("ISSUE_TEMPLATE") + && isYamlFile(path); } public static boolean isIssueConfigFile(final Path path) { return path.getNameCount() > 2 - && path.getName(path.getNameCount() - 3).toString().equalsIgnoreCase(".github") - && path.getName(path.getNameCount() - 2).toString().equalsIgnoreCase("workflow-templates") - && (path.getName(path.getNameCount() - 1).toString().equalsIgnoreCase("config.yml") - || path.getName(path.getNameCount() - 1).toString().equalsIgnoreCase("config.yaml")); + && path.getName(path.getNameCount() - 3).toString().equalsIgnoreCase(".github") + && path.getName(path.getNameCount() - 2).toString().equalsIgnoreCase("workflow-templates") + && (path.getName(path.getNameCount() - 1).toString().equalsIgnoreCase("config.yml") + || path.getName(path.getNameCount() - 1).toString().equalsIgnoreCase("config.yaml")); } public static boolean isFoundingFile(final Path path) { return path.getNameCount() > 1 - && (path.getName(path.getNameCount() - 1).toString().equalsIgnoreCase("FUNDING.yml") - || path.getName(path.getNameCount() - 1).toString().equalsIgnoreCase("FUNDING.yaml")); + && (path.getName(path.getNameCount() - 1).toString().equalsIgnoreCase("FUNDING.yml") + || path.getName(path.getNameCount() - 1).toString().equalsIgnoreCase("FUNDING.yaml")); } public static boolean isDependabotFile(final Path path) { return path.getNameCount() > 1 - && path.getName(path.getNameCount() - 2).toString().equalsIgnoreCase(".github") - && (path.getName(path.getNameCount() - 1).toString().equalsIgnoreCase("dependabot.yml") - || path.getName(path.getNameCount() - 1).toString().equalsIgnoreCase("dependabot.yaml")); + && path.getName(path.getNameCount() - 2).toString().equalsIgnoreCase(".github") + && (path.getName(path.getNameCount() - 1).toString().equalsIgnoreCase("dependabot.yml") + || path.getName(path.getNameCount() - 1).toString().equalsIgnoreCase("dependabot.yaml")); } public static boolean isDiscussionFile(final Path path) { return path.getNameCount() > 2 - && path.getName(path.getNameCount() - 3).toString().equalsIgnoreCase(".github") - && path.getName(path.getNameCount() - 2).toString().equalsIgnoreCase("DISCUSSION_TEMPLATE") - && isYamlFile(path); + && path.getName(path.getNameCount() - 3).toString().equalsIgnoreCase(".github") + && path.getName(path.getNameCount() - 2).toString().equalsIgnoreCase("DISCUSSION_TEMPLATE") + && isYamlFile(path); } } diff --git a/src/main/java/com/github/yunabraska/githubworkflow/helper/HighlightAnnotatorHelper.java b/src/main/java/com/github/yunabraska/githubworkflow/helper/HighlightAnnotatorHelper.java index 2ef15a6..665dcce 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/helper/HighlightAnnotatorHelper.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/helper/HighlightAnnotatorHelper.java @@ -29,14 +29,9 @@ import java.util.function.Consumer; import java.util.stream.Collectors; -import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_CONCLUSION; -import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_OUTCOME; -import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_OUTPUTS; -import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_USES; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.*; import static com.github.yunabraska.githubworkflow.helper.PsiElementHelper.removeQuotes; -import static com.github.yunabraska.githubworkflow.model.NodeIcon.JUMP_TO_IMPLEMENTATION; -import static com.github.yunabraska.githubworkflow.model.NodeIcon.RELOAD; -import static com.github.yunabraska.githubworkflow.model.NodeIcon.SETTINGS; +import static com.github.yunabraska.githubworkflow.model.NodeIcon.*; import static com.github.yunabraska.githubworkflow.model.SyntaxAnnotation.createAnnotation; import static java.util.Optional.ofNullable; @@ -60,28 +55,28 @@ public static void addAnnotation(final AnnotationHolder holder, final PsiElement } public static void ifEnoughItems( - final AnnotationHolder holder, - final PsiElement psiElement, - final SimpleElement[] parts, - final int min, - final int max, - final Consumer then + final AnnotationHolder holder, + final PsiElement psiElement, + final SimpleElement[] parts, + final int min, + final int max, + final Consumer then ) { if (parts.length < min || parts.length < 2) { final TextRange range = psiElement.getTextRange(); new SyntaxAnnotation( - "Incomplete statement [" + Arrays.stream(parts).map(SimpleElement::text).collect(Collectors.joining(".")) + "]", - null, - null + "Incomplete statement [" + Arrays.stream(parts).map(SimpleElement::text).collect(Collectors.joining(".")) + "]", + null, + null ).createAnnotation(psiElement, new TextRange(range.getStartOffset() + parts[0].startIndexOffset(), range.getStartOffset() + parts[parts.length - 1].endIndexOffset()), holder); } else if (max != -1 && parts.length > max) { final TextRange range = psiElement.getTextRange(); final SimpleElement[] tooLongPart = Arrays.copyOfRange(parts, max, parts.length); final TextRange textRange = new TextRange(range.getStartOffset() + tooLongPart[0].startIndexOffset(), range.getStartOffset() + tooLongPart[tooLongPart.length - 1].endIndexOffset()); new SyntaxAnnotation( - "Remove invalid suffix [" + Arrays.stream(tooLongPart).map(SimpleElement::text).collect(Collectors.joining(".")) + "]", - null, - deleteElementAction(textRange) + "Remove invalid suffix [" + Arrays.stream(tooLongPart).map(SimpleElement::text).collect(Collectors.joining(".")) + "]", + null, + deleteElementAction(textRange) ).createAnnotation(psiElement, textRange, holder); } else { then.accept(parts[1]); @@ -94,9 +89,9 @@ public static boolean isDefinedItem0(@NotNull final PsiElement psiElement, @NotN } else if (!items.contains(itemId.text())) { final TextRange textRange = simpleTextRange(psiElement, itemId); createAnnotation(psiElement, textRange, holder, items.stream().map(item -> new SyntaxAnnotation( - "Replace with [" + item + "]", - null, - replaceAction(textRange, item) + "Replace with [" + item + "]", + null, + replaceAction(textRange, item) )).toList()); return false; } @@ -111,9 +106,9 @@ public static boolean isField2Valid(@NotNull final PsiElement psiElement, @NotNu if (!validFields.contains(itemId.text())) { final TextRange textRange = simpleTextRange(psiElement, itemId); new SyntaxAnnotation( - "Remove invalid [" + itemId + "]", - null, - deleteElementAction(textRange) + "Remove invalid [" + itemId + "]", + null, + deleteElementAction(textRange) ).createAnnotation(psiElement, textRange, holder); return false; } @@ -124,9 +119,9 @@ public static void isValidItem3(@NotNull final PsiElement psiElement, @NotNull f if (!isEmpty(outputs, itemId, psiElement, holder) && itemId != null && !outputs.contains(itemId.text())) { final TextRange textRange = simpleTextRange(psiElement, itemId); createAnnotation(psiElement, textRange, holder, outputs.stream().filter(PsiElementHelper::hasText).map(item -> new SyntaxAnnotation( - "Replace with [" + item + "]", - null, - replaceAction(textRange, item) + "Replace with [" + item + "]", + null, + replaceAction(textRange, item) )).toList()); } } @@ -134,36 +129,36 @@ public static void isValidItem3(@NotNull final PsiElement psiElement, @NotNull f @NotNull public static SyntaxAnnotation newReloadAction(final GitHubAction action) { return new SyntaxAnnotation( - "Reload [" + action.name() + "]", - RELOAD, - HighlightSeverity.INFORMATION, - ProblemHighlightType.INFORMATION, - f -> GitHubActionCache.reloadActionAsync(f.project(), action.usesValue()) + "Reload [" + action.name() + "]", + RELOAD, + HighlightSeverity.INFORMATION, + ProblemHighlightType.INFORMATION, + f -> GitHubActionCache.reloadActionAsync(f.project(), action.usesValue()) ); } @NotNull public static SyntaxAnnotation newUnresolvedAction(final YAMLKeyValue element) { return new SyntaxAnnotation( - "Unresolved [" + removeQuotes(element.getValueText()) + "] - you may need to connect your GitHub", - SETTINGS, - HighlightSeverity.WEAK_WARNING, - ProblemHighlightType.WEAK_WARNING, - f -> { - ShowSettingsUtil.getInstance().showSettingsDialog(f.project(), "GitHub"); - resolveAction(element); - } + "Unresolved [" + removeQuotes(element.getValueText()) + "] - you may need to connect your GitHub", + SETTINGS, + HighlightSeverity.WEAK_WARNING, + ProblemHighlightType.WEAK_WARNING, + f -> { + ShowSettingsUtil.getInstance().showSettingsDialog(f.project(), "GitHub"); + resolveAction(element); + } ); } public static SyntaxAnnotation deleteInvalidAction(final YAMLKeyValue element) { final TextRange textRange = ofNullable(element.getValue()).map(PsiElement::getTextRange).orElseGet(element::getTextRange); return new SyntaxAnnotation( - "Remove invalid [" + element.getValueText() + "]", - null, - HighlightSeverity.WEAK_WARNING, - ProblemHighlightType.WEAK_WARNING, - deleteElementAction(textRange) + "Remove invalid [" + element.getValueText() + "]", + null, + HighlightSeverity.WEAK_WARNING, + ProblemHighlightType.WEAK_WARNING, + deleteElementAction(textRange) ); } @@ -171,22 +166,22 @@ public static SyntaxAnnotation deleteInvalidAction(final YAMLKeyValue element) { public static SyntaxAnnotation newJumpToFile(final GitHubAction action) { //TODO: List Workflows connected to the action file return new SyntaxAnnotation( - "Jump to file [" + action.name() + "]", - JUMP_TO_IMPLEMENTATION, - HighlightSeverity.INFORMATION, - ProblemHighlightType.INFORMATION, - f -> jumpToFile(action, f.project()), - false + "Jump to file [" + action.name() + "]", + JUMP_TO_IMPLEMENTATION, + HighlightSeverity.INFORMATION, + ProblemHighlightType.INFORMATION, + f -> jumpToFile(action, f.project()), + false ); } public static void jumpToFile(final GitHubAction action, final Project project) { ofNullable(project) - .map(p -> action) - .flatMap(a -> a.getLocalPath(project)) - .map(path -> LocalFileSystem.getInstance().findFileByPath(path)) - .map(target -> PsiManager.getInstance(project).findFile(target)) - .ifPresent(psiFile -> PsiNavigationSupport.getInstance().createNavigatable(project, psiFile.getVirtualFile(), 0).navigate(true)); + .map(p -> action) + .flatMap(a -> a.getLocalPath(project)) + .map(path -> LocalFileSystem.getInstance().findFileByPath(path)) + .map(target -> PsiManager.getInstance(project).findFile(target)) + .ifPresent(psiFile -> PsiNavigationSupport.getInstance().createNavigatable(project, psiFile.getVirtualFile(), 0).navigate(true)); } @@ -216,8 +211,8 @@ public static TextRange simpleTextRange(@NotNull final PsiElement psiElement, @N final TextRange textRange = psiElement.getTextRange(); final int startOffset = textRange.getStartOffset(); return new TextRange( - Math.max(startOffset + item.startIndexOffset(), startOffset), - Math.min(startOffset + item.endIndexOffset(), textRange.getEndOffset()) + Math.max(startOffset + item.startIndexOffset(), startOffset), + Math.min(startOffset + item.endIndexOffset(), textRange.getEndOffset()) ); } @@ -225,9 +220,9 @@ private static boolean isEmpty(final Collection items, final SimpleEleme if (itemId != null && items.isEmpty()) { final TextRange textRange = simpleTextRange(psiElement, itemId); createAnnotation(psiElement, textRange, holder, List.of(new SyntaxAnnotation( - "Delete invalid [" + itemId.text() + "]", - null, - deleteElementAction(textRange) + "Delete invalid [" + itemId.text() + "]", + null, + deleteElementAction(textRange) ))); return true; } @@ -236,11 +231,11 @@ private static boolean isEmpty(final Collection items, final SimpleEleme private static void resolveAction(final YAMLKeyValue element) { ApplicationManager.getApplication().invokeLater(() -> ofNullable(element) - .filter(PsiElement::isValid) - .flatMap(psiElement -> PsiElementHelper.getParent(psiElement, FIELD_USES)) - .map(GitHubActionCache::getAction) - .filter(action -> !action.isResolved()) - .map(List::of) - .ifPresent(GitHubActionCache::resolveActionsAsync), ModalityState.defaultModalityState()); + .filter(PsiElement::isValid) + .flatMap(psiElement -> PsiElementHelper.getParent(psiElement, FIELD_USES)) + .map(GitHubActionCache::getAction) + .filter(action -> !action.isResolved()) + .map(List::of) + .ifPresent(GitHubActionCache::resolveActionsAsync), ModalityState.defaultModalityState()); } } diff --git a/src/main/java/com/github/yunabraska/githubworkflow/helper/ListenerService.java b/src/main/java/com/github/yunabraska/githubworkflow/helper/ListenerService.java index 1366526..3e794f5 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/helper/ListenerService.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/helper/ListenerService.java @@ -7,10 +7,6 @@ @Service public final class ListenerService implements Disposable { - @Override - public void dispose() { - } - @SuppressWarnings("unused") public static ListenerService getInstance() { return ApplicationManager.getApplication().getService(ListenerService.class); @@ -19,4 +15,8 @@ public static ListenerService getInstance() { public static ListenerService getInstance(final Project project) { return project.getService(ListenerService.class); } + + @Override + public void dispose() { + } } diff --git a/src/main/java/com/github/yunabraska/githubworkflow/helper/PsiElementChangeListener.java b/src/main/java/com/github/yunabraska/githubworkflow/helper/PsiElementChangeListener.java index ce3ae87..9cb3821 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/helper/PsiElementChangeListener.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/helper/PsiElementChangeListener.java @@ -1,7 +1,6 @@ package com.github.yunabraska.githubworkflow.helper; import com.github.yunabraska.githubworkflow.services.GitHubActionCache; -import com.intellij.openapi.application.ApplicationManager; import com.intellij.psi.PsiTreeChangeAdapter; import com.intellij.psi.PsiTreeChangeEvent; import org.jetbrains.annotations.NotNull; @@ -9,8 +8,8 @@ import java.util.List; import java.util.Objects; -import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowHelper.getWorkflowFile; import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_USES; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowHelper.getWorkflowFile; import static java.util.Optional.ofNullable; public class PsiElementChangeListener extends PsiTreeChangeAdapter { diff --git a/src/main/java/com/github/yunabraska/githubworkflow/helper/PsiElementHelper.java b/src/main/java/com/github/yunabraska/githubworkflow/helper/PsiElementHelper.java index bff6093..c5d64da 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/helper/PsiElementHelper.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/helper/PsiElementHelper.java @@ -19,23 +19,13 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; +import java.util.*; import java.util.function.Function; import java.util.function.Predicate; import java.util.regex.Matcher; import java.util.stream.Collectors; -import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_JOBS; -import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_STEPS; -import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.PATTERN_GITHUB_ENV; -import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.PATTERN_GITHUB_OUTPUT; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.*; import static java.util.Collections.unmodifiableList; import static java.util.Optional.ofNullable; @@ -156,42 +146,42 @@ public static Optional getParentStep(final PsiElement psiEleme public static List getChildSteps(final PsiElement psiElement) { return ofNullable(psiElement) - .map(element -> element instanceof final YAMLKeyValue keyValue && FIELD_STEPS.equals(keyValue.getKeyText()) ? List.of(keyValue) : getAllElements(element, FIELD_STEPS)) - .map(yamlKeyValues -> yamlKeyValues.stream().flatMap(steps -> getChildren(steps, YAMLSequenceItem.class).stream().filter(Objects::nonNull)).toList()) - .orElseGet(Collections::emptyList); + .map(element -> element instanceof final YAMLKeyValue keyValue && FIELD_STEPS.equals(keyValue.getKeyText()) ? List.of(keyValue) : getAllElements(element, FIELD_STEPS)) + .map(yamlKeyValues -> yamlKeyValues.stream().flatMap(steps -> getChildren(steps, YAMLSequenceItem.class).stream().filter(Objects::nonNull)).toList()) + .orElseGet(Collections::emptyList); } public static List getChildren(final PsiElement psiElement, final Class clazz) { return ofNullable(psiElement) + .map(PsiElement::getChildren) + .map(psiElements -> Arrays.stream(psiElements).filter(clazz::isInstance).map(clazz::cast).toList()) + .filter(children -> !children.isEmpty()) + .or(() -> ofNullable(psiElement) .map(PsiElement::getChildren) - .map(psiElements -> Arrays.stream(psiElements).filter(clazz::isInstance).map(clazz::cast).toList()) - .filter(children -> !children.isEmpty()) - .or(() -> ofNullable(psiElement) - .map(PsiElement::getChildren) - .flatMap(psiElements -> Arrays.stream(psiElements).map(child -> getChildren(child, clazz)).filter(children -> !children.isEmpty()).findFirst()) - ) - .orElseGet(Collections::emptyList); + .flatMap(psiElements -> Arrays.stream(psiElements).map(child -> getChildren(child, clazz)).filter(children -> !children.isEmpty()).findFirst()) + ) + .orElseGet(Collections::emptyList); } public static Optional getChild(final PsiElement psiElement, final String childKey) { return psiElement == null || childKey == null ? Optional.empty() : Optional.of(psiElement) - .map(PsiElementHelper::getChildren) - .flatMap(children -> children.stream() - .filter(Objects::nonNull) - .filter(child -> childKey.equals(child.getKeyText())) - .findFirst() - .or(() -> children.stream() - .filter(Objects::nonNull) - .map(child -> getChild(child, childKey)) - .filter(Optional::isPresent) - .map(Optional::get) - .findFirst()) - ); + .map(PsiElementHelper::getChildren) + .flatMap(children -> children.stream() + .filter(Objects::nonNull) + .filter(child -> childKey.equals(child.getKeyText())) + .findFirst() + .or(() -> children.stream() + .filter(Objects::nonNull) + .map(child -> getChild(child, childKey)) + .filter(Optional::isPresent) + .map(Optional::get) + .findFirst()) + ); } public static Optional getElementUnderParent(final PsiElement psiElement, final String keyName, final Class clazz) { return psiElement == null || keyName == null ? Optional.empty() : getParent(psiElement, yamlKeyValue -> keyName.equals(yamlKeyValue.getKeyText())) - .flatMap(yamlKeyValue -> getClosestChild(psiElement, yamlKeyValue, clazz)); + .flatMap(yamlKeyValue -> getClosestChild(psiElement, yamlKeyValue, clazz)); } public static Optional getParent(final PsiElement psiElement, final String fieldKey) { @@ -200,12 +190,12 @@ public static Optional getParent(final PsiElement psiElement, fina public static Optional getParent(final PsiElement psiElement, final Predicate filter) { return psiElement == null || filter == null ? Optional.empty() : Optional.of(psiElement) - .flatMap(PsiElementHelper::toYAMLKeyValue) - .filter(filter) - .or(() -> Optional.of(psiElement) - .map(PsiElement::getParent) - .flatMap(parent -> getParent(parent, filter)) - ); + .flatMap(PsiElementHelper::toYAMLKeyValue) + .filter(filter) + .or(() -> Optional.of(psiElement) + .map(PsiElement::getParent) + .flatMap(parent -> getParent(parent, filter)) + ); } public static Optional toYAMLKeyValue(final PsiElement psiElement) { @@ -217,8 +207,8 @@ public static Optional toYAMLKeyValue(final PsiElement psiElement) public static String getDescription(final PsiElement psiElement, final boolean requiredField) { return psiElement == null ? "" : requiredString(psiElement, requiredField) - + getText(psiElement, "default").map(def -> "def[" + def + "]").orElse("") - + getText(psiElement, "description").or(() -> getText(psiElement, "desc")).map(desc -> " " + desc).orElse(""); + + getText(psiElement, "default").map(def -> "def[" + def + "]").orElse("") + + getText(psiElement, "description").or(() -> getText(psiElement, "desc")).map(desc -> " " + desc).orElse(""); } public static Optional toPath(final VirtualFile virtualFile) { @@ -253,9 +243,9 @@ public static boolean hasText(final String str) { public static String goToDeclarationString() { return String.format("Open declaration (%s)", Arrays.stream(KeymapUtil.getActiveKeymapShortcuts("GotoDeclaration").getShortcuts()) - .limit(2) - .map(KeymapUtil::getShortcutText) - .collect(Collectors.joining(", ")) + .limit(2) + .map(KeymapUtil::getShortcutText) + .collect(Collectors.joining(", ")) ); } @@ -298,11 +288,11 @@ private static String removeBrackets(final String text, final char... chars) { private static Optional getClosestChild(final PsiElement from, final YAMLKeyValue to, final Class clazz) { return listAllParents(from, to).stream() - .filter(Objects::nonNull) - .filter(parent -> !(parent instanceof YAMLBlockSequenceImpl)) - .filter(clazz::isInstance) - .findFirst() - .map(clazz::cast); + .filter(Objects::nonNull) + .filter(parent -> !(parent instanceof YAMLBlockSequenceImpl)) + .filter(clazz::isInstance) + .findFirst() + .map(clazz::cast); } private static List listAllParents(final PsiElement from, final PsiElement to) { @@ -321,12 +311,12 @@ private static void listAllParents(final List result, final PsiEleme private static List parseVariables(final LeafPsiElement element, final Function> method) { return ofNullable(element) - .filter(leafPsiElement -> method != null) - .map(line -> method.apply(line.getText()).entrySet().stream() - .map(env -> new SimpleElement(env.getKey(), env.getValue(), line.getTextRange())) - .toList() - ) - .orElseGet(Collections::emptyList); + .filter(leafPsiElement -> method != null) + .map(line -> method.apply(line.getText()).entrySet().stream() + .map(env -> new SimpleElement(env.getKey(), env.getValue(), line.getTextRange())) + .toList() + ) + .orElseGet(Collections::emptyList); } private static List parseVariables(final PsiElement psiElement, final Function> method) { @@ -338,9 +328,9 @@ private static List getLineElements(final PsiElement psiElement) return getChild(psiElement, YAMLBlockScalarImpl.class).map(psi -> { final TextRange parentRange = psi.getTextRange(); return psi.getContentRanges().stream().map(textRange -> new SimpleElement( - null, - removeQuotes(psi.getText().substring(textRange.getStartOffset(), textRange.getEndOffset())), - new TextRange(parentRange.getStartOffset() + textRange.getStartOffset(), parentRange.getStartOffset() + textRange.getEndOffset()) + null, + removeQuotes(psi.getText().substring(textRange.getStartOffset(), textRange.getEndOffset())), + new TextRange(parentRange.getStartOffset() + textRange.getStartOffset(), parentRange.getStartOffset() + textRange.getEndOffset()) )).filter(element -> element.startIndexOffset() < element.endIndexOffset()).filter(element -> hasText(element.text())).toList(); }).orElseGet(Collections::emptyList); } diff --git a/src/main/java/com/github/yunabraska/githubworkflow/logic/Action.java b/src/main/java/com/github/yunabraska/githubworkflow/logic/Action.java index 611fe36..763f2bb 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/logic/Action.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/logic/Action.java @@ -48,6 +48,10 @@ public class Action { + private Action() { + // static helper class + } + // ########## SYNTAX HIGHLIGHTING ########## public static void highLightAction(final AnnotationHolder holder, final YAMLKeyValue element) { final List result = new ArrayList<>(); @@ -142,7 +146,6 @@ private static Optional getAction(final PsiElement psiElement) { .map(GitHubActionCache::getAction); } - private static SyntaxAnnotation newSuppressAction(final GitHubAction action) { final boolean suppressed = action.isSuppressed(); return new SyntaxAnnotation( @@ -192,8 +195,4 @@ private static SyntaxAnnotation newSuppressOutput(final GitHubAction action, fin private static String toggleText(final String id, final boolean suppressed) { return "Toggle warnings [" + (suppressed ? "on" : "off") + "] for [" + id + "]"; } - - private Action() { - // static helper class - } } diff --git a/src/main/java/com/github/yunabraska/githubworkflow/logic/Envs.java b/src/main/java/com/github/yunabraska/githubworkflow/logic/Envs.java index a1d6621..69d9788 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/logic/Envs.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/logic/Envs.java @@ -15,8 +15,8 @@ import java.util.function.Function; import java.util.stream.Collectors; -import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.DEFAULT_VALUE_MAP; import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_ENVS; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_ENVS_MAP; import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_RUN; import static com.github.yunabraska.githubworkflow.helper.HighlightAnnotatorHelper.ifEnoughItems; import static com.github.yunabraska.githubworkflow.helper.HighlightAnnotatorHelper.isDefinedItem0; @@ -35,6 +35,10 @@ public class Envs { + private Envs() { + // static helper class + } + public static void highLightEnvs(final AnnotationHolder holder, final LeafPsiElement element, final SimpleElement[] parts) { ifEnoughItems(holder, element, parts, 2, -1, envId -> isDefinedItem0(element, holder, envId, listEnvs(element).stream().map(SimpleElement::key).toList())); } @@ -106,10 +110,6 @@ private static Function, Map> toMapWithKeyAnd } private static void addDefaultEnvs(final List result) { - result.addAll(completionItemsOf(DEFAULT_VALUE_MAP.get(FIELD_ENVS).get(), ICON_ENV)); - } - - private Envs() { - // static helper class + result.addAll(completionItemsOf(FIELD_ENVS_MAP, ICON_ENV)); } } diff --git a/src/main/java/com/github/yunabraska/githubworkflow/logic/GitHub.java b/src/main/java/com/github/yunabraska/githubworkflow/logic/GitHub.java index 4713c04..d28110e 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/logic/GitHub.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/logic/GitHub.java @@ -7,8 +7,7 @@ import java.util.ArrayList; import java.util.List; -import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.DEFAULT_VALUE_MAP; -import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_GITHUB; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_GITHUB_MAP; import static com.github.yunabraska.githubworkflow.helper.HighlightAnnotatorHelper.ifEnoughItems; import static com.github.yunabraska.githubworkflow.helper.HighlightAnnotatorHelper.isDefinedItem0; import static com.github.yunabraska.githubworkflow.model.NodeIcon.ICON_ENV; @@ -16,15 +15,15 @@ public class GitHub { - public static void highLightGitHub(final AnnotationHolder holder, final LeafPsiElement element, final SimpleElement[] parts) { - ifEnoughItems(holder, element, parts, 2, -1, envId -> isDefinedItem0(element, holder, envId, new ArrayList<>(DEFAULT_VALUE_MAP.get(FIELD_GITHUB).get().keySet()))); + private GitHub() { + // static helper class } - public static List codeCompletionGithub() { - return completionItemsOf(DEFAULT_VALUE_MAP.get(FIELD_GITHUB).get(), ICON_ENV); + public static void highLightGitHub(final AnnotationHolder holder, final LeafPsiElement element, final SimpleElement[] parts) { + ifEnoughItems(holder, element, parts, 2, -1, envId -> isDefinedItem0(element, holder, envId, new ArrayList<>(FIELD_GITHUB_MAP.keySet()))); } - private GitHub() { - // static helper class + public static List codeCompletionGithub() { + return completionItemsOf(FIELD_GITHUB_MAP, ICON_ENV); } } diff --git a/src/main/java/com/github/yunabraska/githubworkflow/logic/Inputs.java b/src/main/java/com/github/yunabraska/githubworkflow/logic/Inputs.java index 3ed90ef..917a60d 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/logic/Inputs.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/logic/Inputs.java @@ -23,6 +23,10 @@ public class Inputs { + private Inputs() { + // static helper class + } + public static void highLightInputs( final AnnotationHolder holder, final LeafPsiElement element, @@ -50,8 +54,4 @@ public static List listInputsRaw(final PsiElement psiElement) { .flatMap(Collection::stream) .toList(); } - - private Inputs() { - // static helper class - } } diff --git a/src/main/java/com/github/yunabraska/githubworkflow/logic/Jobs.java b/src/main/java/com/github/yunabraska/githubworkflow/logic/Jobs.java index 8a3ccf2..38eb5d9 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/logic/Jobs.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/logic/Jobs.java @@ -34,6 +34,10 @@ public class Jobs { + private Jobs() { + // static helper class + } + public static void highLightJobs(final AnnotationHolder holder, final LeafPsiElement element, final SimpleElement[] parts) { ifEnoughItems(holder, element, parts, 4, 4, jobId -> { final List jobs = listJobs(element); @@ -85,8 +89,4 @@ public static SimpleElement jobToCompletionItem(final YAMLKeyValue item) { NodeIcon.ICON_NEEDS ); } - - private Jobs() { - // static helper class - } } diff --git a/src/main/java/com/github/yunabraska/githubworkflow/logic/Needs.java b/src/main/java/com/github/yunabraska/githubworkflow/logic/Needs.java index e0fbf3f..4888a9d 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/logic/Needs.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/logic/Needs.java @@ -30,15 +30,12 @@ import static com.github.yunabraska.githubworkflow.helper.HighlightAnnotatorHelper.isField2Valid; import static com.github.yunabraska.githubworkflow.helper.HighlightAnnotatorHelper.isValidItem3; import static com.github.yunabraska.githubworkflow.helper.HighlightAnnotatorHelper.newJumpToFile; -import static com.github.yunabraska.githubworkflow.helper.PsiElementHelper.getAllJobs; import static com.github.yunabraska.githubworkflow.helper.PsiElementHelper.getChild; import static com.github.yunabraska.githubworkflow.helper.PsiElementHelper.getParent; import static com.github.yunabraska.githubworkflow.helper.PsiElementHelper.getParentJob; import static com.github.yunabraska.githubworkflow.helper.PsiElementHelper.getTextElement; import static com.github.yunabraska.githubworkflow.helper.PsiElementHelper.getTextElements; import static com.github.yunabraska.githubworkflow.helper.PsiElementHelper.goToDeclarationString; -import static com.github.yunabraska.githubworkflow.helper.PsiElementHelper.isTextElement; -import static com.github.yunabraska.githubworkflow.helper.PsiElementHelper.removeQuotes; import static com.github.yunabraska.githubworkflow.logic.Jobs.listAllJobs; import static com.github.yunabraska.githubworkflow.logic.Jobs.listJobOutputs; import static java.util.Optional.ofNullable; @@ -47,6 +44,10 @@ public class Needs { // ########## SYNTAX HIGHLIGHTING ########## + private Needs() { + // static helper class + } + // variable field public static void highlightNeeds(final AnnotationHolder holder, final LeafPsiElement element, final SimpleElement[] parts) { ifEnoughItems(holder, element, parts, 4, 4, jobId -> { @@ -66,7 +67,7 @@ public static void highlightNeeds(final AnnotationHolder holder, final PsiElemen .filter(PsiElementHelper::isTextElement) .filter(element -> getParent(element, FIELD_NEEDS).isPresent()) .ifPresent(element -> { - final List jobsNames = listJobs(psiElement).stream().map(YAMLKeyValue::getKeyText).toList(); + final List jobsNames = listJobs(psiElement).stream().map(YAMLKeyValue::getKeyText).toList(); if (!jobsNames.contains(element.getText())) { // INVALID JOB_ID addAnnotation(holder, psiElement, new SyntaxAnnotation( @@ -108,7 +109,12 @@ public static Optional referenceNeeds(final PsiElement psiElemen .map(job -> new PsiReference[]{new LocalReferenceResolver(psiElement, job)}); } - private static void highlightLocalActions(final AnnotationHolder holder, final YAMLKeyValue element, final GitHubAction action, final List result) { + private static void highlightLocalActions( // todo not used??? + final AnnotationHolder holder, + final YAMLKeyValue element, + final GitHubAction action, + final List result + ) { if (action.isResolved() && action.isLocal()) { final String tooltip = String.format("Open declaration (%s)", Arrays.stream(KeymapUtil.getActiveKeymapShortcuts("GotoDeclaration").getShortcuts()) .limit(2) @@ -147,8 +153,4 @@ public static Optional getJobNeed(final PsiElement psiElement) { .flatMap(PsiElementHelper::getParentJob) .flatMap(job -> getChild(job, FIELD_NEEDS)); } - - private Needs() { - // static helper class - } } diff --git a/src/main/java/com/github/yunabraska/githubworkflow/logic/Runner.java b/src/main/java/com/github/yunabraska/githubworkflow/logic/Runner.java index 36bc033..77856c1 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/logic/Runner.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/logic/Runner.java @@ -7,8 +7,7 @@ import java.util.ArrayList; import java.util.List; -import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.DEFAULT_VALUE_MAP; -import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_RUNNER; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_RUNNER_MAP; import static com.github.yunabraska.githubworkflow.helper.HighlightAnnotatorHelper.ifEnoughItems; import static com.github.yunabraska.githubworkflow.helper.HighlightAnnotatorHelper.isDefinedItem0; import static com.github.yunabraska.githubworkflow.model.NodeIcon.ICON_RUNNER; @@ -16,15 +15,15 @@ public class Runner { - public static void highlightRunner(final AnnotationHolder holder, final LeafPsiElement element, final SimpleElement[] parts) { - ifEnoughItems(holder, element, parts, 2, 2, runnerId -> isDefinedItem0(element, holder, runnerId, new ArrayList<>(DEFAULT_VALUE_MAP.get(FIELD_RUNNER).get().keySet()))); + private Runner() { + // static helper class } - public static List codeCompletionRunner() { - return completionItemsOf(DEFAULT_VALUE_MAP.get(FIELD_RUNNER).get(), ICON_RUNNER); + public static void highlightRunner(final AnnotationHolder holder, final LeafPsiElement element, final SimpleElement[] parts) { + ifEnoughItems(holder, element, parts, 2, 2, runnerId -> isDefinedItem0(element, holder, runnerId, new ArrayList<>(FIELD_RUNNER_MAP.keySet()))); } - private Runner() { - // static helper class + public static List codeCompletionRunner() { + return completionItemsOf(FIELD_RUNNER_MAP, ICON_RUNNER); } } diff --git a/src/main/java/com/github/yunabraska/githubworkflow/logic/Secrets.java b/src/main/java/com/github/yunabraska/githubworkflow/logic/Secrets.java index 6bc9a0e..acd9a4e 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/logic/Secrets.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/logic/Secrets.java @@ -33,6 +33,10 @@ public class Secrets { + private Secrets() { + // static helper class + } + public static void highLightSecrets( final AnnotationHolder holder, final PsiElement psiElement, @@ -74,8 +78,4 @@ public static List listSecrets(final PsiElement psiElement) { .map(map -> completionItemsOf(map, ICON_SECRET_WORKFLOW)) .orElseGet(ArrayList::new); } - - private Secrets() { - // static helper class - } } diff --git a/src/main/java/com/github/yunabraska/githubworkflow/logic/Steps.java b/src/main/java/com/github/yunabraska/githubworkflow/logic/Steps.java index d5d5d0e..a1073b1 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/logic/Steps.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/logic/Steps.java @@ -43,6 +43,10 @@ public class Steps { + private Steps() { + // static helper class + } + // ########## SYNTAX HIGHLIGHTING ########## public static void highlightSteps(final AnnotationHolder holder, final LeafPsiElement psiElement, final SimpleElement[] parts) { if (parts.length > 2 && List.of(FIELD_CONCLUSION, FIELD_OUTCOME).contains(parts[2].text())) { @@ -114,8 +118,4 @@ private static List listRunOutputs(final YAMLSequenceItem step) { .map(outputs -> outputs.stream().map(output -> completionItemOf(output.key(), output.text(), ICON_TEXT_VARIABLE)).toList()) ).orElseGet(Collections::emptyList); } - - private Steps() { - // static helper class - } } diff --git a/src/main/java/com/github/yunabraska/githubworkflow/model/GitHubAction.java b/src/main/java/com/github/yunabraska/githubworkflow/model/GitHubAction.java index 54a5feb..0b4e66b 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/model/GitHubAction.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/model/GitHubAction.java @@ -56,20 +56,18 @@ @SuppressWarnings("unused") public class GitHubAction implements Serializable { + // STATICS + @Serial + private static final long serialVersionUID = 135457798745235490L; + private static final Logger LOG = Logger.getInstance(GitHubAction.class); // SERIALIZABLE private final Map metaData = new ConcurrentHashMap<>(); private final Map inputs = new ConcurrentHashMap<>(); private final Map outputs = new ConcurrentHashMap<>(); - // NON SERIALIZABLE private final Set ignoredInputs = ConcurrentHashMap.newKeySet(); private final Set ignoredOutputs = ConcurrentHashMap.newKeySet(); - // STATICS - @Serial - private static final long serialVersionUID = 135457798745235490L; - private static final Logger LOG = Logger.getInstance(GitHubAction.class); - public static GitHubAction createSchemaAction(final String url, final String content) { return new GitHubAction() .isResolved(true) @@ -119,6 +117,80 @@ public static GitHubAction createGithubAction(final boolean isLocal, final Strin ; } + public static VirtualFile findActionYaml(final String subPath, final VirtualFile projectDir) { + return ofNullable(projectDir.findFileByRelativePath(subPath)).filter(p -> !p.isDirectory()) + .or(() -> ofNullable(projectDir.findFileByRelativePath(subPath + "/action.yml")).filter(VirtualFile::isValid).filter(p -> !p.isDirectory())) + .or(() -> ofNullable(projectDir.findFileByRelativePath(subPath + "/action.yaml")).filter(VirtualFile::isValid).filter(p -> !p.isDirectory())) + .orElse(null); + } + + @Nullable + private static String toRemoteDownloadUrl(final boolean isAction, final String ref, final String slug, final String sub, final String name) { + return isAction ? toActionDownloadUrl(ref, slug, sub) : toWorkflowDownloadUrl(ref, slug, name); + } + + @Nullable + private static String toWorkflowDownloadUrl(final String ref, final String slug, final String name) { + return (ref != null && slug != null) ? "https://raw.githubusercontent.com/" + slug + "/" + ref + "/.github/workflows/" + name : null; + } + + @Nullable + private static String toActionDownloadUrl(final String ref, final String slug, final String sub) { + return (ref != null && slug != null && sub != null) ? "https://raw.githubusercontent.com/" + slug + "/" + ref + sub + "/action.yml" : null; + } + + @Nullable + private static String toGitHubWorkflowUrl(final String ref, final String slug, final String name) { + return (ref != null && slug != null) ? "https://github.com/" + slug + "/blob/" + ref + "/.github/workflows/" + name : null; + } + + @Nullable + private static String toGitHubActionUrl(final String ref, final String slug, final String sub) { + // return (ref != null && slug != null && sub != null) ? "https://github.com/" + slug + "/blob/" + ref + sub + "/action.yml" : null; + // https://github.com/actions/checkout/tree/Update-description#readme + return (ref != null && slug != null && sub != null) ? "https://github.com/" + slug + "/tree/" + ref + sub + "#readme" : null; + } + + @NotNull + private static Map getActionParameters(final PsiElement psiElement, final String fieldName, final boolean action) { + if (action) { + return readActionParameters(psiElement, fieldName); + } else { + return readWorkflowParameters(psiElement, fieldName); + } + } + + @NotNull + private static Map readActionParameters(final PsiElement psiElement, final String fieldName) { + return getChild(psiElement.getContainingFile(), fieldName) + .map(PsiElementHelper::getChildren) + .map(children -> children.stream().collect(Collectors.toMap(YAMLKeyValue::getKeyText, field -> PsiElementHelper.getDescription(field, FIELD_INPUTS.equals(fieldName))))) + .orElseGet(Collections::emptyMap); + } + + @NotNull + private static Map readWorkflowParameters(final PsiElement psiElement, final String fieldName) { + return getChild(psiElement.getContainingFile(), FIELD_ON) + .flatMap(keyValue -> getChild(psiElement.getContainingFile(), fieldName)) + .map(PsiElementHelper::getChildren) + .map(children -> children.stream().collect(Collectors.toMap(YAMLKeyValue::getKeyText, field -> PsiElementHelper.getDescription(field, FIELD_INPUTS.equals(fieldName))))) + .orElseGet(Collections::emptyMap); + } + + private static void readPsiElement(final Project project, final String fileName, final String fileContent, final Consumer action) { + ApplicationManager.getApplication().runReadAction(() -> { + try { + ofNullable(action).ifPresent(consumer -> consumer.accept(PsiFileFactory.getInstance(project).createFileFromText(fileName, YAMLFileType.YML, fileContent.replaceAll("\r?\\n|\\r", "\n")))); + } catch (final Exception ignored) { + // ignored + } + }); + } + + private static Map concatMap(final Map map1, final Map map2) { + return Stream.concat(map1.entrySet().stream(), map2.entrySet().stream()).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (v1, v2) -> v1)); + } + public Optional getLocalPath(final Project project) { return isLocal() ? ofNullable(project) .map(ProjectUtil::guessProjectDir) @@ -262,7 +334,6 @@ public Set ignoredOutputs() { return unmodifiableSet(ignoredOutputs); } - public Map getInputs() { return unmodifiableMap(inputs); } @@ -292,13 +363,6 @@ public GitHubAction setMetaData(final Map metaData) { return this; } - public static VirtualFile findActionYaml(final String subPath, final VirtualFile projectDir) { - return ofNullable(projectDir.findFileByRelativePath(subPath)).filter(p -> !p.isDirectory()) - .or(() -> ofNullable(projectDir.findFileByRelativePath(subPath + "/action.yml")).filter(VirtualFile::isValid).filter(p -> !p.isDirectory())) - .or(() -> ofNullable(projectDir.findFileByRelativePath(subPath + "/action.yaml")).filter(VirtualFile::isValid).filter(p -> !p.isDirectory())) - .orElse(null); - } - private void extractParameters() { try { if (isLocal()) { @@ -314,8 +378,16 @@ private void extractParameters() { private void extractRemoteParameters() { try { - CompletableFuture.runAsync(() -> ofNullable(downloadFileFromGitHub(downloadUrl())).or(() -> ofNullable(downloadContent(downloadUrl()))).ifPresent(this::setParameters)).orTimeout(5000, TimeUnit.MILLISECONDS).join(); - ofNullable(downloadFileFromGitHub(downloadUrl())).or(() -> ofNullable(downloadContent(downloadUrl()))).ifPresent(this::setParameters); + CompletableFuture + .runAsync(() -> + ofNullable(downloadFileFromGitHub(downloadUrl())) + .or(() -> ofNullable(downloadContent(downloadUrl()))) + .ifPresent(this::setParameters)) + .orTimeout(5000, TimeUnit.MILLISECONDS) + .join(); + ofNullable(downloadFileFromGitHub(downloadUrl())) + .or(() -> ofNullable(downloadContent(downloadUrl()))) + .ifPresent(this::setParameters); } catch (final Exception exception) { Log.error("Download failed", exception); } @@ -341,73 +413,6 @@ private void setParameters(final String content) { }); } - @Nullable - private static String toRemoteDownloadUrl(final boolean isAction, final String ref, final String slug, final String sub, final String name) { - return isAction ? toActionDownloadUrl(ref, slug, sub) : toWorkflowDownloadUrl(ref, slug, name); - } - - @Nullable - private static String toWorkflowDownloadUrl(final String ref, final String slug, final String name) { - return (ref != null && slug != null) ? "https://raw.githubusercontent.com/" + slug + "/" + ref + "/.github/workflows/" + name : null; - } - - @Nullable - private static String toActionDownloadUrl(final String ref, final String slug, final String sub) { - return (ref != null && slug != null && sub != null) ? "https://raw.githubusercontent.com/" + slug + "/" + ref + sub + "/action.yml" : null; - } - - @Nullable - private static String toGitHubWorkflowUrl(final String ref, final String slug, final String name) { - return (ref != null && slug != null) ? "https://github.com/" + slug + "/blob/" + ref + "/.github/workflows/" + name : null; - } - - @Nullable - private static String toGitHubActionUrl(final String ref, final String slug, final String sub) { - // return (ref != null && slug != null && sub != null) ? "https://github.com/" + slug + "/blob/" + ref + sub + "/action.yml" : null; - // https://github.com/actions/checkout/tree/Update-description#readme - return (ref != null && slug != null && sub != null) ? "https://github.com/" + slug + "/tree/" + ref + sub + "#readme" : null; - } - - @NotNull - private static Map getActionParameters(final PsiElement psiElement, final String fieldName, final boolean action) { - if (action) { - return readActionParameters(psiElement, fieldName); - } else { - return readWorkflowParameters(psiElement, fieldName); - } - } - - @NotNull - private static Map readActionParameters(final PsiElement psiElement, final String fieldName) { - return getChild(psiElement.getContainingFile(), fieldName) - .map(PsiElementHelper::getChildren) - .map(children -> children.stream().collect(Collectors.toMap(YAMLKeyValue::getKeyText, field -> PsiElementHelper.getDescription(field, FIELD_INPUTS.equals(fieldName))))) - .orElseGet(Collections::emptyMap); - } - - @NotNull - private static Map readWorkflowParameters(final PsiElement psiElement, final String fieldName) { - return getChild(psiElement.getContainingFile(), FIELD_ON) - .flatMap(keyValue -> getChild(psiElement.getContainingFile(), fieldName)) - .map(PsiElementHelper::getChildren) - .map(children -> children.stream().collect(Collectors.toMap(YAMLKeyValue::getKeyText, field -> PsiElementHelper.getDescription(field, FIELD_INPUTS.equals(fieldName))))) - .orElseGet(Collections::emptyMap); - } - - private static void readPsiElement(final Project project, final String fileName, final String fileContent, final Consumer action) { - ApplicationManager.getApplication().runReadAction(() -> { - try { - ofNullable(action).ifPresent(consumer -> consumer.accept(PsiFileFactory.getInstance(project).createFileFromText(fileName, YAMLFileType.YML, fileContent.replaceAll("\r?\\n|\\r", "\n")))); - } catch (final Exception ignored) { - // ignored - } - }); - } - - private static Map concatMap(final Map map1, final Map map2) { - return Stream.concat(map1.entrySet().stream(), map2.entrySet().stream()).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (v1, v2) -> v1)); - } - @Override public boolean equals(final Object o) { if (this == o) return true; diff --git a/src/main/java/com/github/yunabraska/githubworkflow/model/GitHubSchemaProvider.java b/src/main/java/com/github/yunabraska/githubworkflow/model/GitHubSchemaProvider.java index 8a43c4c..78966c4 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/model/GitHubSchemaProvider.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/model/GitHubSchemaProvider.java @@ -11,7 +11,6 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Path; -import java.nio.file.Paths; import java.util.Objects; import java.util.Optional; import java.util.Scanner; diff --git a/src/main/java/com/github/yunabraska/githubworkflow/model/LocalActionReferenceResolver.java b/src/main/java/com/github/yunabraska/githubworkflow/model/LocalActionReferenceResolver.java index d86145d..8269559 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/model/LocalActionReferenceResolver.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/model/LocalActionReferenceResolver.java @@ -2,12 +2,7 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.LocalFileSystem; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementResolveResult; -import com.intellij.psi.PsiManager; -import com.intellij.psi.PsiPolyVariantReference; -import com.intellij.psi.PsiReferenceBase; -import com.intellij.psi.ResolveResult; +import com.intellij.psi.*; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -26,11 +21,11 @@ public LocalActionReferenceResolver(@NotNull final PsiElement element) { return ofNullable(myElement.getUserData(ACTION_KEY)).flatMap(action -> { final Project project = getProject(myElement); return ofNullable(project) - .flatMap(action::getLocalPath) - .map(path -> LocalFileSystem.getInstance().findFileByPath(path)) - .map(virtualFile -> PsiManager.getInstance(project).findFile(virtualFile)) - .map(target -> target.getChildren().length > 0 ? target.getChildren()[0] : target) - .map(target -> new ResolveResult[]{(new PsiElementResolveResult(target))}); + .flatMap(action::getLocalPath) + .map(path -> LocalFileSystem.getInstance().findFileByPath(path)) + .map(virtualFile -> PsiManager.getInstance(project).findFile(virtualFile)) + .map(target -> target.getChildren().length > 0 ? target.getChildren()[0] : target) + .map(target -> new ResolveResult[]{(new PsiElementResolveResult(target))}); }).orElse(ResolveResult.EMPTY_ARRAY); } diff --git a/src/main/java/com/github/yunabraska/githubworkflow/model/LocalReferenceResolver.java b/src/main/java/com/github/yunabraska/githubworkflow/model/LocalReferenceResolver.java index 17cf656..9e8780d 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/model/LocalReferenceResolver.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/model/LocalReferenceResolver.java @@ -1,10 +1,6 @@ package com.github.yunabraska.githubworkflow.model; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementResolveResult; -import com.intellij.psi.PsiPolyVariantReference; -import com.intellij.psi.PsiReferenceBase; -import com.intellij.psi.ResolveResult; +import com.intellij.psi.*; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/src/main/java/com/github/yunabraska/githubworkflow/model/QuickFixExecution.java b/src/main/java/com/github/yunabraska/githubworkflow/model/QuickFixExecution.java index 701d1bd..ae9f4e3 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/model/QuickFixExecution.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/model/QuickFixExecution.java @@ -1,6 +1,5 @@ package com.github.yunabraska.githubworkflow.model; -import com.github.yunabraska.githubworkflow.model.SyntaxAnnotation; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiFile; diff --git a/src/main/java/com/github/yunabraska/githubworkflow/model/SimpleElement.java b/src/main/java/com/github/yunabraska/githubworkflow/model/SimpleElement.java index e8492eb..4d7955b 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/model/SimpleElement.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/model/SimpleElement.java @@ -27,6 +27,21 @@ public SimpleElement(final String text, final TextRange range) { this(null, text, range, null); } + public static List completionItemsOf(final Map map, final NodeIcon icon) { + return map == null ? new ArrayList<>() : map.entrySet().stream() + .map(item -> completionItemOf(item.getKey(), item.getValue(), icon)) + .filter(Objects::nonNull) + .collect(Collectors.toCollection(ArrayList::new)); + } + + public static SimpleElement completionItemOf(final String key, final String text, final NodeIcon icon) { + return key == null ? null : new SimpleElement(key, orEmpty(text), icon); + } + + private static String orEmpty(final String text) { + return ofNullable(text).orElse(""); + } + @SuppressWarnings("unused") public NodeIcon icon() { return icon != null ? icon : NodeIcon.ICON_NODE; @@ -48,19 +63,4 @@ public LookupElement toLookupElement() { return GitHubWorkflowHelper.toLookupElement(icon, Character.MIN_VALUE, key, text); } - public static List completionItemsOf(final Map map, final NodeIcon icon) { - return map == null ? new ArrayList<>() : map.entrySet().stream() - .map(item -> completionItemOf(item.getKey(), item.getValue(), icon)) - .filter(Objects::nonNull) - .collect(Collectors.toCollection(ArrayList::new)); - } - - public static SimpleElement completionItemOf(final String key, final String text, final NodeIcon icon) { - return key == null ? null : new SimpleElement(key, orEmpty(text), icon); - } - - private static String orEmpty(final String text) { - return ofNullable(text).orElse(""); - } - } diff --git a/src/main/java/com/github/yunabraska/githubworkflow/model/SyntaxAnnotation.java b/src/main/java/com/github/yunabraska/githubworkflow/model/SyntaxAnnotation.java index 22038ae..937d768 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/model/SyntaxAnnotation.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/model/SyntaxAnnotation.java @@ -65,26 +65,6 @@ public SyntaxAnnotation( this.showToolTip = showToolTip; } - @Override - public void invoke(@NotNull final Project project, final Editor editor, final PsiFile file) throws IncorrectOperationException { - ofNullable(execute).ifPresent(projectConsumer -> projectConsumer.accept(new QuickFixExecution(this, project, editor, file))); - } - - public void createAnnotation( - final PsiElement psiElement, - final AnnotationHolder holder - ) { - createAnnotation(psiElement, psiElement.getTextRange(), holder); - } - - public void createAnnotation( - final PsiElement psiElement, - final TextRange range, - final AnnotationHolder holder - ) { - createAnnotation(psiElement, range, holder, List.of(this)); - } - @SuppressWarnings("ResultOfMethodCallIgnored") public static void createAnnotation( final PsiElement psiElement, @@ -106,6 +86,26 @@ public static void createAnnotation( } } + @Override + public void invoke(@NotNull final Project project, final Editor editor, final PsiFile file) throws IncorrectOperationException { + ofNullable(execute).ifPresent(projectConsumer -> projectConsumer.accept(new QuickFixExecution(this, project, editor, file))); + } + + public void createAnnotation( + final PsiElement psiElement, + final AnnotationHolder holder + ) { + createAnnotation(psiElement, psiElement.getTextRange(), holder); + } + + public void createAnnotation( + final PsiElement psiElement, + final TextRange range, + final AnnotationHolder holder + ) { + createAnnotation(psiElement, range, holder, List.of(this)); + } + @SuppressWarnings("unused") public Icon icon() { return icon.icon(); diff --git a/src/main/java/com/github/yunabraska/githubworkflow/model/VariableReferenceResolver.java b/src/main/java/com/github/yunabraska/githubworkflow/model/VariableReferenceResolver.java index 9898646..110587a 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/model/VariableReferenceResolver.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/model/VariableReferenceResolver.java @@ -1,10 +1,6 @@ package com.github.yunabraska.githubworkflow.model; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementResolveResult; -import com.intellij.psi.PsiPolyVariantReference; -import com.intellij.psi.PsiReferenceBase; -import com.intellij.psi.ResolveResult; +import com.intellij.psi.*; import com.jetbrains.rd.util.AtomicReference; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -13,14 +9,8 @@ import java.util.List; import java.util.Objects; -import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_ID; -import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_INPUTS; -import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_JOBS; -import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_NEEDS; -import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_STEPS; -import static com.github.yunabraska.githubworkflow.helper.PsiElementHelper.getChild; -import static com.github.yunabraska.githubworkflow.helper.PsiElementHelper.getTextElements; -import static com.github.yunabraska.githubworkflow.helper.PsiElementHelper.removeQuotes; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.*; +import static com.github.yunabraska.githubworkflow.helper.PsiElementHelper.*; import static com.github.yunabraska.githubworkflow.logic.Inputs.listInputsRaw; import static com.github.yunabraska.githubworkflow.logic.Jobs.listJobs; import static com.github.yunabraska.githubworkflow.logic.Needs.getJobNeed; @@ -44,13 +34,13 @@ public VariableReferenceResolver(@NotNull final PsiElement element) { final AtomicReference reference = new AtomicReference<>(null); switch (parts.length > 1 ? parts[0].text() : "N/A") { case FIELD_INPUTS -> - listInputsRaw(myElement).stream().filter(input -> input.getKeyText().equals(parts[1].text())).findFirst().ifPresent(reference::getAndSet); + listInputsRaw(myElement).stream().filter(input -> input.getKeyText().equals(parts[1].text())).findFirst().ifPresent(reference::getAndSet); case FIELD_JOBS -> - listJobs(myElement).stream().filter(input -> input.getKeyText().equals(parts[1].text())).findFirst().ifPresent(reference::getAndSet); + listJobs(myElement).stream().filter(input -> input.getKeyText().equals(parts[1].text())).findFirst().ifPresent(reference::getAndSet); case FIELD_NEEDS -> - getJobNeed(myElement).stream().flatMap(need -> getTextElements(need).stream()).filter(need -> removeQuotes(need.getText()).equals(parts[1].text())).findFirst().ifPresent(reference::getAndSet); + getJobNeed(myElement).stream().flatMap(need -> getTextElements(need).stream()).filter(need -> removeQuotes(need.getText()).equals(parts[1].text())).findFirst().ifPresent(reference::getAndSet); case FIELD_STEPS -> - listSteps(myElement).stream().map(step -> getChild(step, FIELD_ID).orElse(null)).filter(Objects::nonNull).filter(input -> input.getKeyText().equals(parts[1].text())).findFirst().ifPresent(reference::getAndSet); + listSteps(myElement).stream().map(step -> getChild(step, FIELD_ID).orElse(null)).filter(Objects::nonNull).filter(input -> input.getKeyText().equals(parts[1].text())).findFirst().ifPresent(reference::getAndSet); default -> reference.getAndSet(null); } ofNullable(reference.get()).map(PsiElementResolveResult::new).ifPresent(resolveResults::add); diff --git a/src/main/java/com/github/yunabraska/githubworkflow/services/ActionVersionService.java b/src/main/java/com/github/yunabraska/githubworkflow/services/ActionVersionService.java new file mode 100644 index 0000000..cc7366f --- /dev/null +++ b/src/main/java/com/github/yunabraska/githubworkflow/services/ActionVersionService.java @@ -0,0 +1,142 @@ +package com.github.yunabraska.githubworkflow.services; + +import com.fasterxml.jackson.databind.JsonNode; +import com.intellij.openapi.components.Service; +import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.project.Project; +import org.jetbrains.plugins.github.api.GithubApiRequest; +import org.jetbrains.plugins.github.api.GithubApiRequestExecutor; +import org.jetbrains.plugins.github.authentication.GHAccountsUtil; +import org.jetbrains.plugins.github.authentication.accounts.GithubAccount; +import org.jetbrains.plugins.github.util.GHCompatibilityUtil; +import org.jetbrains.plugins.github.util.GHGitRepositoryMapping; +import org.jetbrains.plugins.github.util.GHHostedRepositoriesManager; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +@Service(Service.Level.PROJECT) +final public class ActionVersionService { + private static final Logger LOG = Logger.getInstance(ActionVersionService.class); + private static final Map CACHE = new HashMap<>(); + private final String serverPath; + private final GithubApiRequestExecutor requestExecutor; + + public ActionVersionService(final Project project, final String token) { + this.requestExecutor = createRequestExecutor(project, token); + this.serverPath = determineServerPath(project); + } + + public ActionVersionService(final Project project) { + this(project, getGitHubToken(project)); + } + + private String determineServerPath(final Project project) { + var repoManager = project.getService(GHHostedRepositoriesManager.class); + final Set mappings = repoManager.getKnownRepositoriesState().getValue(); + if (mappings.isEmpty()) { + LOG.info("No repository mappings, using default graphql url"); + return "https://api.github.com/graphql"; + } else { + final GHGitRepositoryMapping mapping = mappings.iterator().next(); + return mapping.getRepository().getServerPath().toGraphQLUrl(); + } + } + + private GithubApiRequestExecutor createRequestExecutor(final Project project, final String token) { + return GithubApiRequestExecutor.Factory.getInstance().create(token); + } + + private static String getGitHubToken(final Project project) { + var gitHubAccounts = GHAccountsUtil.getAccounts(); + for (final GithubAccount account : gitHubAccounts) { + var token = GHCompatibilityUtil.getOrRequestToken(account, project); + if (token != null) { + return token; + } + } + LOG.warn("No GitHub account found"); + throw new RuntimeException("No GitHub account found"); + } + + /** + * Gets latest version of action from GitHub + * + * @param fullActionName action name in format org/name + * @return latest version of action, null if not found or exception occurred + */ + String getLatestActionVersion(final String fullActionName) { + if (fullActionName == null || fullActionName.startsWith("./")) { + return null; // Local actions don't have versions + } + if (CACHE.containsKey(fullActionName)) { + return CACHE.get(fullActionName); + } + final String actionOrg = fullActionName.split("/")[0]; + final String actionName = fullActionName.split("/")[1]; + final GithubApiRequest.Post.GQLQuery request = new GithubApiRequest.Post.GQLQuery.TraversedParsed<>( + serverPath, "getLatestRelease.graphql", + Map.of("owner", actionOrg, "name", actionName), + JsonNode.class, + "repository", "latestRelease", "tag", "name"); + try { + final JsonNode response = requestExecutor.execute(request); + final String version = response.toString().replace("\"", ""); + CACHE.put(actionName, version); + return version; + } catch (IOException e) { + LOG.warn("Failed to get latest version of action " + fullActionName, e); + } + return null; + } + + /** + * Checks if action current version is outdated + * + * @param actionName action name + * @param currentVersion current version + * @return true if action is outdated + */ + Boolean isActionOutdated(String actionName, String currentVersion) { + String latestVersion = getLatestActionVersion(actionName); + if (latestVersion == null) { + return false; + } + if (latestVersion.startsWith("v")) { + latestVersion = latestVersion.substring(1); + } + if (currentVersion.startsWith("v")) { + currentVersion = currentVersion.substring(1); + } + // Comparing only major versions + LOG.info(String.format("Comparing %s versions: %s and %s", actionName, latestVersion, currentVersion)); + final String majorLatest = latestVersion.split("\\.")[0]; + final String majorCurrent = currentVersion.split("\\.")[0]; + return !majorLatest.equals(majorCurrent); + } + + /** + * Extracts all actions from workflow yaml + * + * @param workflowYaml yaml text + * @return map of action name and version used + */ + Map getAllActionsWithCurrentVersions(String workflowYaml) { + // TODO + return new HashMap<>(); + } + + /** + * Extracts all outdated actions from workflow yaml + * + * @param workflowYaml yaml text + * @return map of action name and latest version + */ + Map getOutdatedActions(final String workflowYaml) { + final Map allActions = getAllActionsWithCurrentVersions(workflowYaml); + //TODO + return null; + } +} diff --git a/src/main/java/com/github/yunabraska/githubworkflow/services/CodeCompletion.java b/src/main/java/com/github/yunabraska/githubworkflow/services/CodeCompletion.java index cafbdb7..69f5045 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/services/CodeCompletion.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/services/CodeCompletion.java @@ -18,14 +18,26 @@ import org.jetbrains.annotations.NotNull; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; -import java.util.function.Supplier; -import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.*; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_CONCLUSION; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_DEFAULT_MAP; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_ENVS; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_GITHUB; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_INPUTS; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_JOBS; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_NEEDS; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_ON; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_OUTCOME; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_OUTPUTS; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_RUN; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_RUNNER; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_SECRETS; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_STEPS; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_USES; import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowHelper.getCaretBracketItem; import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowHelper.getStartIndex; import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowHelper.getWorkflowFile; @@ -77,8 +89,12 @@ public void addCompletions( if (caretBracketItem.isEmpty()) { if (getParent(position, FIELD_RUN).isPresent() && position.getText().contains("$IntellijIdeaRulezzz")) { // AUTO COMPLETE [$GITHUB_ENV, $GITHUB_OUTPUT] - final Map defaults = ofNullable(DEFAULT_VALUE_MAP.get(FIELD_DEFAULT)).map(Supplier::get).orElseGet(Collections::emptyMap); - addLookupElements(resultSet.withPrefixMatcher(prefix[0]), Map.of("GITHUB_ENV", defaults.getOrDefault(FIELD_ENVS, ""), "GITHUB_OUTPUT", defaults.getOrDefault(FIELD_GITHUB, "")), NodeIcon.ICON_ENV, Character.MIN_VALUE); + addLookupElements( + resultSet.withPrefixMatcher(prefix[0]), + Map.of("GITHUB_ENV", FIELD_DEFAULT_MAP.getOrDefault(FIELD_ENVS, ""), + "GITHUB_OUTPUT", FIELD_DEFAULT_MAP.getOrDefault(FIELD_GITHUB, "")), + NodeIcon.ICON_ENV, + Character.MIN_VALUE); } else if (getParent(position, FIELD_NEEDS).isPresent()) { //[jobs.job_name.needs] list previous jobs Optional.of(codeCompletionNeeds(position)).filter(cil -> !cil.isEmpty()) @@ -173,7 +189,7 @@ private static void handleFirstItem(final String[] cbi, final int i, final PsiEl final boolean isOnOutput = getParent(position, FIELD_OUTPUTS).flatMap(outputs -> getParent(position, FIELD_ON)).isPresent(); // SHOW ONLY JOBS [on.workflow_call.outputs.key.value:xxx] if (isOnOutput) { - completionItemMap.put(i, singletonList(completionItemOf(FIELD_JOBS, DEFAULT_VALUE_MAP.get(FIELD_DEFAULT).get().get(FIELD_JOBS), ICON_JOB))); + completionItemMap.put(i, singletonList(completionItemOf(FIELD_JOBS, FIELD_DEFAULT_MAP.get(FIELD_JOBS), ICON_JOB))); } else if (getParent(position, "runs-on").isEmpty() && getParent(position, "os").isEmpty()) { // DEFAULT addDefaultCodeCompletionItems(i, position, completionItemMap); @@ -183,8 +199,7 @@ private static void handleFirstItem(final String[] cbi, final int i, final PsiEl } private static void addDefaultCodeCompletionItems(final int i, final PsiElement position, final Map> completionItemMap) { - ofNullable(DEFAULT_VALUE_MAP.getOrDefault(FIELD_DEFAULT, null)) - .map(Supplier::get) + Optional.of(FIELD_DEFAULT_MAP) .map(map -> { final Map copyMap = new HashMap<>(map); Optional.of(listInputs(position)).filter(List::isEmpty).ifPresent(empty -> copyMap.remove(FIELD_INPUTS)); diff --git a/src/main/java/com/github/yunabraska/githubworkflow/services/FileIconProvider.java b/src/main/java/com/github/yunabraska/githubworkflow/services/FileIconProvider.java index f87f27e..0e48409 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/services/FileIconProvider.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/services/FileIconProvider.java @@ -20,16 +20,16 @@ public class FileIconProvider extends IconProvider { @SuppressWarnings("java:S2637") public Icon getIcon(@NotNull final PsiElement element, final int flags) { return Optional.of(element) - .filter(PsiFile.class::isInstance) - .map(PsiFile.class::cast) - .map(PsiFile::getVirtualFile) - .flatMap(virtualFile -> SCHEMA_FILE_PROVIDERS.stream() - .filter(GitHubSchemaProvider.class::isInstance) - .map(GitHubSchemaProvider.class::cast) - .filter(schemaProvider -> schemaProvider.isAvailable(virtualFile)) - .map(schema -> AllIcons.Vcs.Vendors.Github) - .findFirst() - ) - .orElse(null); + .filter(PsiFile.class::isInstance) + .map(PsiFile.class::cast) + .map(PsiFile::getVirtualFile) + .flatMap(virtualFile -> SCHEMA_FILE_PROVIDERS.stream() + .filter(GitHubSchemaProvider.class::isInstance) + .map(GitHubSchemaProvider.class::cast) + .filter(schemaProvider -> schemaProvider.isAvailable(virtualFile)) + .map(schema -> AllIcons.Vcs.Vendors.Github) + .findFirst() + ) + .orElse(null); } } diff --git a/src/main/java/com/github/yunabraska/githubworkflow/services/GitHubActionCache.java b/src/main/java/com/github/yunabraska/githubworkflow/services/GitHubActionCache.java index 5258a99..807d4c3 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/services/GitHubActionCache.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/services/GitHubActionCache.java @@ -44,16 +44,78 @@ @State(name = "GitHubActionCache", storages = {@Storage("githubActionCache.xml")}) public class GitHubActionCache implements PersistentStateComponent { - public static class State { - public final Map actions = new ConcurrentHashMap<>(); - } - private final State state = new State(); public static GitHubActionCache getActionCache() { return ApplicationManager.getApplication().getService(GitHubActionCache.class); } + public static void triggerSyntaxHighlightingForActiveFiles() { + ApplicationManager.getApplication().invokeLater(() -> + Stream.of(ProjectManager.getInstance().getOpenProjects()).forEach(project -> Stream.of(FileEditorManager.getInstance(project).getSelectedFiles()).filter(VirtualFile::isValid) + .filter(virtualFile -> toPath(virtualFile).map(GitHubWorkflowHelper::isWorkflowPath).orElse(false)) + .forEach(virtualFile -> ofNullable(PsiManager.getInstance(project).findFile(virtualFile)) + .filter(PsiFile::isValid) + .ifPresent(psiFile -> { + if (DaemonCodeAnalyzer.getInstance(project).isHighlightingAvailable(psiFile)) { + DaemonCodeAnalyzer.getInstance(project).restart(psiFile); + } + }) + ) + ) + ); + } + + public static void resolveActionsAsync(final Collection actions) { + threadPoolExec(ProjectManager.getInstance().getDefaultProject(), () -> getActionCache().resolveAsync(actions)); + } + + public static GitHubAction reloadActionAsync(final Project project, final String usesValue) { + return getActionCache().reloadAsync(project, usesValue); + } + + public static GitHubAction getAction(final PsiElement psiElement) { + return getUsesString(psiElement).map(usesValue -> getActionCache().get(getProject(psiElement), usesValue)).orElse(null); + } + + @SuppressWarnings("unused") + public static PsiElement removeAction(final PsiElement psiElement) { + getUsesString(psiElement).ifPresent(GitHubActionCache::removeAction); + return psiElement; + } + + public static GitHubAction removeAction(final GitHubAction action) { + ofNullable(action).map(GitHubAction::downloadUrl).ifPresent(GitHubActionCache::removeAction); + return action; + } + + public static String removeAction(final String usesValue) { + ofNullable(usesValue).ifPresent(value -> getActionCache().remove(value)); + return usesValue; + } + + public static Optional isUseElement(final PsiElement psiElement) { + return ofNullable(psiElement) + .filter(PsiElement::isValid) + .filter(YAMLKeyValue.class::isInstance) + .map(YAMLKeyValue.class::cast) + .filter(keyValue -> FIELD_USES.equals(keyValue.getKeyText())); + } + + private static Optional getUsesString(final PsiElement psiElement) { + return ofNullable(psiElement).filter(PsiElement::isValid) + .flatMap(GitHubActionCache::getUsesValue) + .or(() -> getChildWithUsesValue(psiElement)); + } + + private static Optional getUsesValue(final PsiElement psiElement) { + return isUseElement(psiElement).flatMap(PsiElementHelper::getText); + } + + private static Optional getChildWithUsesValue(final PsiElement psiElement) { + return ofNullable(psiElement).filter(PsiElement::isValid).flatMap(element -> PsiElementHelper.getChild(element, FIELD_USES)).flatMap(PsiElementHelper::getText); + } + @Nullable @Override public State getState() { @@ -136,58 +198,6 @@ public void run(@NotNull final ProgressIndicator indicator) { }.queue(); } - public static void triggerSyntaxHighlightingForActiveFiles() { - ApplicationManager.getApplication().invokeLater(() -> - Stream.of(ProjectManager.getInstance().getOpenProjects()).forEach(project -> Stream.of(FileEditorManager.getInstance(project).getSelectedFiles()).filter(VirtualFile::isValid) - .filter(virtualFile -> toPath(virtualFile).map(GitHubWorkflowHelper::isWorkflowPath).orElse(false)) - .forEach(virtualFile -> ofNullable(PsiManager.getInstance(project).findFile(virtualFile)) - .filter(PsiFile::isValid) - .ifPresent(psiFile -> { - if (DaemonCodeAnalyzer.getInstance(project).isHighlightingAvailable(psiFile)) { - DaemonCodeAnalyzer.getInstance(project).restart(psiFile); - } - }) - ) - ) - ); - } - - public static void resolveActionsAsync(final Collection actions) { - threadPoolExec(ProjectManager.getInstance().getDefaultProject(), () -> getActionCache().resolveAsync(actions)); - } - - public static GitHubAction reloadActionAsync(final Project project, final String usesValue) { - return getActionCache().reloadAsync(project, usesValue); - } - - public static GitHubAction getAction(final PsiElement psiElement) { - return getUsesString(psiElement).map(usesValue -> getActionCache().get(getProject(psiElement), usesValue)).orElse(null); - } - - @SuppressWarnings("unused") - public static PsiElement removeAction(final PsiElement psiElement) { - getUsesString(psiElement).ifPresent(GitHubActionCache::removeAction); - return psiElement; - } - - public static GitHubAction removeAction(final GitHubAction action) { - ofNullable(action).map(GitHubAction::downloadUrl).ifPresent(GitHubActionCache::removeAction); - return action; - } - - public static String removeAction(final String usesValue) { - ofNullable(usesValue).ifPresent(value -> getActionCache().remove(value)); - return usesValue; - } - - public static Optional isUseElement(final PsiElement psiElement) { - return ofNullable(psiElement) - .filter(PsiElement::isValid) - .filter(YAMLKeyValue.class::isInstance) - .map(YAMLKeyValue.class::cast) - .filter(keyValue -> FIELD_USES.equals(keyValue.getKeyText())); - } - private GitHubAction saveNewAction(final Project project, final GitHubAction oldAction) { final boolean isLocal = !oldAction.usesValue().contains("@"); return saveNewAction(oldAction.usesValue(), getAbsolutePath(isLocal, oldAction.usesValue(), project), isLocal, oldAction); @@ -217,18 +227,8 @@ private String getAbsolutePath(final boolean isLocal, final String subPath, fina .orElse(subPath); } - private static Optional getUsesString(final PsiElement psiElement) { - return ofNullable(psiElement).filter(PsiElement::isValid) - .flatMap(GitHubActionCache::getUsesValue) - .or(() -> getChildWithUsesValue(psiElement)); - } - - private static Optional getUsesValue(final PsiElement psiElement) { - return isUseElement(psiElement).flatMap(PsiElementHelper::getText); - } - - private static Optional getChildWithUsesValue(final PsiElement psiElement) { - return ofNullable(psiElement).filter(PsiElement::isValid).flatMap(element -> PsiElementHelper.getChild(element, FIELD_USES)).flatMap(PsiElementHelper::getText); + public static class State { + public final Map actions = new ConcurrentHashMap<>(); } } diff --git a/src/main/java/com/github/yunabraska/githubworkflow/services/HighlightAnnotator.java b/src/main/java/com/github/yunabraska/githubworkflow/services/HighlightAnnotator.java index 7461eef..ab7548c 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/services/HighlightAnnotator.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/services/HighlightAnnotator.java @@ -26,7 +26,21 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.*; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_ENVS; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_GITHUB; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_ID; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_IF; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_INPUTS; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_JOBS; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_NEEDS; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_ON; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_OUTPUTS; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_RUN; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_RUNNER; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_SECRETS; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_STEPS; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_USES; +import static com.github.yunabraska.githubworkflow.helper.GitHubWorkflowConfig.FIELD_WITH; import static com.github.yunabraska.githubworkflow.helper.HighlightAnnotatorHelper.deleteElementAction; import static com.github.yunabraska.githubworkflow.helper.HighlightAnnotatorHelper.getFirstChild; import static com.github.yunabraska.githubworkflow.helper.PsiElementHelper.getAllElements; @@ -52,18 +66,7 @@ public class HighlightAnnotator implements Annotator { - @Override - public void annotate(@NotNull final PsiElement psiElement, @NotNull final AnnotationHolder holder) { - //it's needed to handle single elements instead of bulk wise from parent. Parent elements are doesn't update so often. - if (psiElement.isValid()) { - processPsiElement(holder, psiElement); - variableElementHandler(holder, psiElement); - highlightRunOutputs(holder, psiElement); - // HIGHLIGHT ACTION INPUTS - highlightActionInput(holder, psiElement); - highlightNeeds(holder, psiElement); - } - } + public static final Key VARIABLE_ELEMENTS = new Key<>("com.github.yunabraska.githubworkflow.VariableElements"); //TODO: handle single elements instead of bulk updates for more reliability public static void processPsiElement(final AnnotationHolder holder, final PsiElement psiElement) { @@ -133,8 +136,6 @@ public static Predicate isElementWithVariables(final YAMLKeyValue pa .isPresent(); } - public static final Key VARIABLE_ELEMENTS = new Key<>("com.github.yunabraska.githubworkflow.VariableElements"); - @NotNull public static List toSimpleElements(final PsiElement element) { return Arrays.stream(element.getText().split("\\R")) @@ -229,5 +230,18 @@ private static int validateAndAddElement(final StringBuilder currentElement, fin return elementStart; } + @Override + public void annotate(@NotNull final PsiElement psiElement, @NotNull final AnnotationHolder holder) { + //it's needed to handle single elements instead of bulk wise from parent. Parent elements are doesn't update so often. + if (psiElement.isValid()) { + processPsiElement(holder, psiElement); + variableElementHandler(holder, psiElement); + highlightRunOutputs(holder, psiElement); + // HIGHLIGHT ACTION INPUTS + highlightActionInput(holder, psiElement); + highlightNeeds(holder, psiElement); + } + } + } diff --git a/src/main/java/com/github/yunabraska/githubworkflow/services/PluginErrorReportSubmitter.java b/src/main/java/com/github/yunabraska/githubworkflow/services/PluginErrorReportSubmitter.java index 0a05de2..816d3a7 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/services/PluginErrorReportSubmitter.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/services/PluginErrorReportSubmitter.java @@ -44,10 +44,10 @@ public boolean submit(final IdeaLoggingEvent @NotNull [] events, sb.append(URLEncoder.encode(StringUtil.splitByLines(throwableText)[0], UTF_8)); ofNullable(event.getThrowable()) - .map(Throwable::getMessage) - .or(() -> Optional.of(throwableText).map(title -> StringUtil.splitByLines(title)[0])) - .map(title -> "&title=" + URLEncoder.encode(title, UTF_8)) - .ifPresent(sb::append); + .map(Throwable::getMessage) + .or(() -> Optional.of(throwableText).map(title -> StringUtil.splitByLines(title)[0])) + .map(title -> "&title=" + URLEncoder.encode(title, UTF_8)) + .ifPresent(sb::append); sb.append("&body="); sb.append(URLEncoder.encode("\n\n### Description\n", UTF_8)); @@ -64,7 +64,7 @@ public boolean submit(final IdeaLoggingEvent @NotNull [] events, assert descriptor != null; sb.append(URLEncoder.encode("Plugin version : " + descriptor.getVersion() + "\n", UTF_8)); sb.append(URLEncoder.encode("IDE: " + ApplicationInfo.getInstance().getFullApplicationName() + - " (" + ApplicationInfo.getInstance().getBuild().asString() + ")\n", UTF_8)); + " (" + ApplicationInfo.getInstance().getBuild().asString() + ")\n", UTF_8)); sb.append(URLEncoder.encode("OS: " + SystemInfo.getOsNameAndVersion(), UTF_8)); sb.append(URLEncoder.encode("\n\n### Stacktrace\n", UTF_8)); diff --git a/src/main/java/com/github/yunabraska/githubworkflow/services/ProjectStartup.java b/src/main/java/com/github/yunabraska/githubworkflow/services/ProjectStartup.java index 87c4c09..3626252 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/services/ProjectStartup.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/services/ProjectStartup.java @@ -36,6 +36,33 @@ public class ProjectStartup implements ProjectActivity { + private static void asyncInitAllActions(final Project project, final VirtualFile virtualFile) { + final Runnable task = () -> { + if (virtualFile != null && (GitHubWorkflowHelper.isWorkflowPath(toPath(virtualFile.getPath())))) { + final List actions = new ArrayList<>(); + // READ CONTEXT + ApplicationManager.getApplication().runReadAction(() -> Optional.of(PsiManager.getInstance(project)) + .map(psiManager -> psiManager.findFile(virtualFile)) + .map(psiFile -> PsiElementHelper.getAllElements(psiFile, FIELD_USES)) + .ifPresent(usesList -> usesList.stream().map(GitHubActionCache::getAction).filter(action -> !action.isSuppressed()).filter(action -> !action.isResolved()).forEach(actions::add)) + ); + + // ASYNC HTTP CONTEXT + GitHubActionCache.resolveActionsAsync(actions); + } + }; + + threadPoolExec(project, task); + } + + public static void threadPoolExec(final Project project, final Runnable task) { + if (!DumbService.isDumb(project)) { + ApplicationManager.getApplication().executeOnPooledThread(task); + } else { + DumbService.getInstance(project).runWhenSmart(() -> ApplicationManager.getApplication().executeOnPooledThread(task)); + } + } + @Nullable @Override public Object execute(@NotNull final Project project, @NotNull final Continuation continuation) { @@ -78,31 +105,4 @@ private void unregisterAction(final Project project) { actionManager.unregisterAction(oldId); } } - - private static void asyncInitAllActions(final Project project, final VirtualFile virtualFile) { - final Runnable task = () -> { - if (virtualFile != null && (GitHubWorkflowHelper.isWorkflowPath(toPath(virtualFile.getPath())))) { - final List actions = new ArrayList<>(); - // READ CONTEXT - ApplicationManager.getApplication().runReadAction(() -> Optional.of(PsiManager.getInstance(project)) - .map(psiManager -> psiManager.findFile(virtualFile)) - .map(psiFile -> PsiElementHelper.getAllElements(psiFile, FIELD_USES)) - .ifPresent(usesList -> usesList.stream().map(GitHubActionCache::getAction).filter(action -> !action.isSuppressed()).filter(action -> !action.isResolved()).forEach(actions::add)) - ); - - // ASYNC HTTP CONTEXT - GitHubActionCache.resolveActionsAsync(actions); - } - }; - - threadPoolExec(project, task); - } - - public static void threadPoolExec(final Project project, final Runnable task) { - if (!DumbService.isDumb(project)) { - ApplicationManager.getApplication().executeOnPooledThread(task); - } else { - DumbService.getInstance(project).runWhenSmart(() -> ApplicationManager.getApplication().executeOnPooledThread(task)); - } - } } diff --git a/src/main/java/com/github/yunabraska/githubworkflow/services/ReferenceContributor.java b/src/main/java/com/github/yunabraska/githubworkflow/services/ReferenceContributor.java index 12af833..6a8f591 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/services/ReferenceContributor.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/services/ReferenceContributor.java @@ -4,11 +4,7 @@ import com.github.yunabraska.githubworkflow.model.GitHubAction; import com.intellij.openapi.util.Key; import com.intellij.patterns.PlatformPatterns; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiReference; -import com.intellij.psi.PsiReferenceContributor; -import com.intellij.psi.PsiReferenceProvider; -import com.intellij.psi.PsiReferenceRegistrar; +import com.intellij.psi.*; import com.intellij.util.ProcessingContext; import org.jetbrains.annotations.NotNull; @@ -25,26 +21,26 @@ public class ReferenceContributor extends PsiReferenceContributor { @Override public void registerReferenceProviders(@NotNull final PsiReferenceRegistrar registrar) { registrar.registerReferenceProvider( - PlatformPatterns.psiElement(PsiElement.class), - new PsiReferenceProvider() { - @NotNull - @Override - public PsiReference @NotNull [] getReferencesByElement( - @NotNull final PsiElement psiElement, - @NotNull final ProcessingContext context - ) { - return getWorkflowFile(psiElement).isEmpty() ? PsiReference.EMPTY_ARRAY : Optional.of(psiElement) - .filter(PsiElementHelper::isTextElement) - .flatMap(element -> { - final String text = element.getText().replace("IntellijIdeaRulezzz ", "").replace("IntellijIdeaRulezzz", ""); - return referenceGithubAction(element) - .or(() -> referenceNeeds(element, text)) - ; - } - ) - .orElse(PsiReference.EMPTY_ARRAY); - } + PlatformPatterns.psiElement(PsiElement.class), + new PsiReferenceProvider() { + @NotNull + @Override + public PsiReference @NotNull [] getReferencesByElement( + @NotNull final PsiElement psiElement, + @NotNull final ProcessingContext context + ) { + return getWorkflowFile(psiElement).isEmpty() ? PsiReference.EMPTY_ARRAY : Optional.of(psiElement) + .filter(PsiElementHelper::isTextElement) + .flatMap(element -> { + final String text = element.getText().replace("IntellijIdeaRulezzz ", "").replace("IntellijIdeaRulezzz", ""); + return referenceGithubAction(element) + .or(() -> referenceNeeds(element, text)) + ; + } + ) + .orElse(PsiReference.EMPTY_ARRAY); } + } ); } } diff --git a/src/main/java/com/github/yunabraska/githubworkflow/services/SchemaProvider.java b/src/main/java/com/github/yunabraska/githubworkflow/services/SchemaProvider.java index dab0c95..90cd7ad 100644 --- a/src/main/java/com/github/yunabraska/githubworkflow/services/SchemaProvider.java +++ b/src/main/java/com/github/yunabraska/githubworkflow/services/SchemaProvider.java @@ -13,17 +13,17 @@ public class SchemaProvider implements JsonSchemaProviderFactory { protected static final List SCHEMA_FILE_PROVIDERS = Stream.of( - new GitHubSchemaProvider("dependabot-2.0", "Dependabot [Auto]", GitHubWorkflowHelper::isDependabotFile), - new GitHubSchemaProvider("github-action", "GitHub Action [Auto]", GitHubWorkflowHelper::isActionFile), - new GitHubSchemaProvider("github-funding", "GitHub Funding [Auto]", GitHubWorkflowHelper::isFoundingFile), - new GitHubSchemaProvider("github-workflow", "GitHub Workflow [Auto]", GitHubWorkflowHelper::isWorkflowFile), - new GitHubSchemaProvider("github-discussion", "GitHub Discussion [Auto]", GitHubWorkflowHelper::isDiscussionFile), - new GitHubSchemaProvider("github-issue-forms", "GitHub Issue Forms [Auto]", GitHubWorkflowHelper::isIssueForms), - new GitHubSchemaProvider("github-issue-config", "GitHub Workflow Issue Template configuration [Auto]", GitHubWorkflowHelper::isIssueConfigFile), - new GitHubSchemaProvider("github-workflow-template-properties", "GitHub Workflow Template Properties [Auto]", GitHubWorkflowHelper::isWorkflowTemplatePropertiesFile) - ) - .distinct() - .toList(); + new GitHubSchemaProvider("dependabot-2.0", "Dependabot [Auto]", GitHubWorkflowHelper::isDependabotFile), + new GitHubSchemaProvider("github-action", "GitHub Action [Auto]", GitHubWorkflowHelper::isActionFile), + new GitHubSchemaProvider("github-funding", "GitHub Funding [Auto]", GitHubWorkflowHelper::isFoundingFile), + new GitHubSchemaProvider("github-workflow", "GitHub Workflow [Auto]", GitHubWorkflowHelper::isWorkflowFile), + new GitHubSchemaProvider("github-discussion", "GitHub Discussion [Auto]", GitHubWorkflowHelper::isDiscussionFile), + new GitHubSchemaProvider("github-issue-forms", "GitHub Issue Forms [Auto]", GitHubWorkflowHelper::isIssueForms), + new GitHubSchemaProvider("github-issue-config", "GitHub Workflow Issue Template configuration [Auto]", GitHubWorkflowHelper::isIssueConfigFile), + new GitHubSchemaProvider("github-workflow-template-properties", "GitHub Workflow Template Properties [Auto]", GitHubWorkflowHelper::isWorkflowTemplatePropertiesFile) + ) + .distinct() + .toList(); @NotNull @Override diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index f89d09d..c8a5dd7 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -20,7 +20,8 @@ implementationClass="com.github.yunabraska.githubworkflow.services.HighlightAnnotator"/> - + diff --git a/src/main/resources/META-INF/pluginIcon.svg b/src/main/resources/META-INF/pluginIcon.svg index af615c4..11573bc 100644 --- a/src/main/resources/META-INF/pluginIcon.svg +++ b/src/main/resources/META-INF/pluginIcon.svg @@ -1,15 +1,22 @@ - - + + - + - - - _ - C + + + _ + C diff --git a/src/main/resources/META-INF/pluginIcon_dark.svg b/src/main/resources/META-INF/pluginIcon_dark.svg index 2df2444..faf574d 100644 --- a/src/main/resources/META-INF/pluginIcon_dark.svg +++ b/src/main/resources/META-INF/pluginIcon_dark.svg @@ -1,15 +1,22 @@ - - + + - + - - - _ - C + + + _ + C diff --git a/src/main/resources/getLatestRelease.graphql b/src/main/resources/getLatestRelease.graphql new file mode 100644 index 0000000..230d4a8 --- /dev/null +++ b/src/main/resources/getLatestRelease.graphql @@ -0,0 +1,10 @@ + +query($owner:String!,$name:String!) { + repository(owner:$owner, name:$name){ + latestRelease{ + tag{ + name + } + } + } +} diff --git a/src/main/resources/schemas/dependabot-2.0.json b/src/main/resources/schemas/dependabot-2.0.json index 6275c14..baaf860 100644 --- a/src/main/resources/schemas/dependabot-2.0.json +++ b/src/main/resources/schemas/dependabot-2.0.json @@ -1,376 +1,1075 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "additionalProperties": false, - "definitions": { - "dependency-type": { - "type": "string", - "enum": ["direct", "indirect", "all", "production", "development"], - "x-intellij-enum-metadata": { - "direct": { - "description": "All explicitly defined dependencies." - }, - "indirect": { - "description": "Dependencies of direct dependencies (also known as sub-dependencies, or transient dependencies)." - }, - "all": { - "description": "All explicitly defined dependencies. For bundler, pip, composer, cargo, also the dependencies of direct dependencies." - }, - "production": { - "description": "Only dependencies in the 'Product dependency group'." - }, - "development": { - "description": "Only dependencies in the 'Development dependency group'." - } - } - }, - "update-types": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "version-update:semver-major", - "version-update:semver-minor", - "version-update:semver-patch" - ] - } - }, - "insecure-external-code-execution": { - "type": "string", - "enum": ["allow", "deny"] - }, - "versioning-strategy": { - "type": "string", - "enum": [ - "lockfile-only", - "auto", - "widen", - "increase", - "increase-if-necessary" - ], - "x-intellij-enum-metadata": { - "lockfile-only": { - "description": "Only create pull requests to update lockfiles updates. Ignore any new versions that would require package manifest changes." - }, - "auto": { - "description": "Follow the default strategy described above." - }, - "widen": { - "description": "Relax the version requirement to include both the new and old version, when possible." - }, - "increase": { - "description": "Always increase the version requirement to match the new version." - }, - "increase-if-necessary": { - "description": "Increase the version requirement only when required by the new version." - } - } - }, - "package-ecosystem": { - "type": "string", - "enum": [ - "bundler", - "cargo", - "composer", - "docker", - "elm", - "gitsubmodule", - "github-actions", - "gomod", - "gradle", - "maven", - "mix", - "npm", - "nuget", - "pip", - "pub", - "terraform" - ] - }, - "schedule-day": { - "type": "string", - "enum": [ - "monday", - "tuesday", - "wednesday", - "thursday", - "friday", - "saturday", - "sunday" - ] - }, - "schedule-interval": { - "type": "string", - "enum": ["daily", "weekly", "monthly"] - }, - "update": { - "type": "object", - "properties": { - "allow": { - "description": "Customize which updates are allowed", - "type": "array", - "items": { - "type": "object", - "properties": { - "dependency-name": { - "type": "string" - }, - "dependency-type": { - "$ref": "#/definitions/dependency-type" - } - } - } - }, - "assignees": { - "description": "Assignees to set on pull requests", - "type": "array", - "items": { - "type": "string" - }, - "minimum": 1 - }, - "commit-message": { - "description": "Commit message preferences", - "type": "object", - "properties": { - "prefix": { - "type": "string" - }, - "prefix-development": { - "type": "string" - }, - "include": { - "type": "string", - "enum": ["scope"], - "default": "scope" - } - } - }, - "directory": { - "description": "Location of package manifests", - "type": "string", - "default": "/" - }, - "ignore": { - "description": "Ignore certain dependencies or versions", - "type": "array", - "items": { - "type": "object", - "properties": { - "dependency-name": { - "type": "string" - }, - "update-types": { - "$ref": "#/definitions/update-types" - }, - "versions": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - }, - "insecure-external-code-execution": { - "description": "Allow or deny code execution in manifest files", - "$ref": "#/definitions/insecure-external-code-execution" - }, - "labels": { - "description": "Labels to set on pull requests", - "type": "array", - "items": { - "type": "string" - }, - "default": ["dependencies"] - }, - "milestone": { - "description": "Milestone to set on pull requests", - "anyOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ] - }, - "open-pull-requests-limit": { - "description": "Limit number of open pull requests for version updates", - "type": "integer", - "default": 5 - }, - "package-ecosystem": { - "description": "Package manager to use", - "$ref": "#/definitions/package-ecosystem" - }, - "pull-request-branch-name": { - "description": "Pull request branch name preferences", - "type": "object", - "properties": { - "separator": { - "description": "Change separator for PR branch name", - "type": "string", - "default": "/", - "enum": ["-", "_", "/"] - } - }, - "required": ["separator"] - }, - "rebase-strategy": { - "description": "Disable automatic rebasing", - "type": "string", - "enum": ["auto", "disabled"], - "default": "auto" - }, - "reviewers": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Reviewers to set on pull requests", - "minimum": 1 - }, - "schedule": { - "description": "Schedule preferences", - "type": "object", - "properties": { - "interval": { - "$ref": "#/definitions/schedule-interval" - }, - "day": { - "$ref": "#/definitions/schedule-day", - "description": "Specify an alternative day to check for updates" - }, - "time": { - "type": "string", - "description": "Specify an alternative time of day to check for updates (format: hh:mm)" - }, - "timezone": { - "type": "string", - "description": "The time zone identifier must be from the Time Zone database maintained by IANA", - "default": "05:00 UTC" - } - } - }, - "target-branch": { - "type": "string", - "description": "Branch to create pull requests against" - }, - "vendor": { - "description": "Update vendored or cached dependencies", - "type": "boolean" - }, - "versioning-strategy": { - "description": "How to update manifest version requirements", - "$ref": "#/definitions/versioning-strategy" - } - }, - "required": ["package-ecosystem", "directory", "schedule"] - }, - "registry": { - "type": "object", - "title": "registries", - "description": "The top-level registries key is optional. It allows you to specify authentication details that Dependabot can use to access private package registries.", - "additionalProperties": false, - "patternProperties": { - ".*": { - "type": "object", - "additionalProperties": false, - "properties": { - "type": { - "description": "Identifies the type of registry.", - "enum": [ - "composer-repository", - "docker-registry", - "git", - "hex-organization", - "hex-repository", - "maven-repository", - "npm-registry", - "nuget-feed", - "python-index", - "rubygems-server", - "terraform-registry" - ] - }, - "url": { - "description": "The URL to use to access the dependencies in this registry. The protocol is optional. If not specified, https:// is assumed. Dependabot adds or ignores trailing slashes as required.", - "type": "string" - }, - "username": { - "description": "The username that Dependabot uses to access the registry.", - "type": "string" - }, - "password": { - "description": "A reference to a Dependabot secret containing the password for the specified user.", - "type": "string" - }, - "key": { - "description": "A reference to a Dependabot secret containing an access key for this registry.", - "type": "string" - }, - "token": { - "description": "A reference to a Dependabot secret containing an access token for this registry.", - "type": "string" - }, - "replaces-base": { - "description": "For registries with type: python-index, if the boolean value is true, pip resolves dependencies by using the specified URL rather than the base URL of the Python Package Index (by default https://pypi.org/simple).", - "type": "boolean" - }, - "organization": { - "description": "", - "type": "string" - }, - "repo": { - "description": "", - "type": "string" - }, - "auth-key": { - "description": "", - "type": "string" - }, - "public-key-fingerprint": { - "description": "", - "type": "string" - } - }, - "required": ["type"] - } - } - } - }, - "id": "https://json.schemastore.org/dependabot-2.0.json", - "properties": { - "version": { - "anyOf": [ - { - "type": "string", - "default": "2" - }, - { - "type": "integer", - "default": 2 - } - ] - }, - "enable-beta-ecosystems": { - "description": "Enable ecosystems that have beta-level support", - "type": "boolean" - }, - "updates": { - "type": "array", - "items": { - "title": "Package Ecosystem", - "description": "Element for each one package manager that you want GitHub Dependabot to monitor for new versions", - "$ref": "#/definitions/update" - } - }, - "registries": { - "type": "object", - "$ref": "#/definitions/registry" - } - }, - "required": ["version", "updates"], - "title": "GitHub Dependabot v2 config", - "type": "object" -} +{ + "$id": "https://json.schemastore.org/dependabot-2.0.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "definitions": { + "timezone": { + "$id": "timezone", + "type": "string", + "enum": [ + "Africa/Abidjan", + "Africa/Accra", + "Africa/Addis_Ababa", + "Africa/Algiers", + "Africa/Asmara", + "Africa/Asmera", + "Africa/Bamako", + "Africa/Bangui", + "Africa/Banjul", + "Africa/Bissau", + "Africa/Blantyre", + "Africa/Brazzaville", + "Africa/Bujumbura", + "Africa/Cairo", + "Africa/Casablanca", + "Africa/Ceuta", + "Africa/Conakry", + "Africa/Dakar", + "Africa/Dar_es_Salaam", + "Africa/Djibouti", + "Africa/Douala", + "Africa/El_Aaiun", + "Africa/Freetown", + "Africa/Gaborone", + "Africa/Harare", + "Africa/Johannesburg", + "Africa/Juba", + "Africa/Kampala", + "Africa/Khartoum", + "Africa/Kigali", + "Africa/Kinshasa", + "Africa/Lagos", + "Africa/Libreville", + "Africa/Lome", + "Africa/Luanda", + "Africa/Lubumbashi", + "Africa/Lusaka", + "Africa/Malabo", + "Africa/Maputo", + "Africa/Maseru", + "Africa/Mbabane", + "Africa/Mogadishu", + "Africa/Monrovia", + "Africa/Nairobi", + "Africa/Ndjamena", + "Africa/Niamey", + "Africa/Nouakchott", + "Africa/Ouagadougou", + "Africa/Porto-Novo", + "Africa/Sao_Tome", + "Africa/Timbuktu", + "Africa/Tripoli", + "Africa/Tunis", + "Africa/Windhoek", + "America/Adak", + "America/Anchorage", + "America/Anguilla", + "America/Antigua", + "America/Araguaina", + "America/Argentina/Buenos_Aires", + "America/Argentina/Catamarca", + "America/Argentina/ComodRivadavia", + "America/Argentina/Cordoba", + "America/Argentina/Jujuy", + "America/Argentina/La_Rioja", + "America/Argentina/Mendoza", + "America/Argentina/Rio_Gallegos", + "America/Argentina/Salta", + "America/Argentina/San_Juan", + "America/Argentina/San_Luis", + "America/Argentina/Tucuman", + "America/Argentina/Ushuaia", + "America/Aruba", + "America/Asuncion", + "America/Atikokan", + "America/Atka", + "America/Bahia", + "America/Bahia_Banderas", + "America/Barbados", + "America/Belem", + "America/Belize", + "America/Blanc-Sablon", + "America/Boa_Vista", + "America/Bogota", + "America/Boise", + "America/Buenos_Aires", + "America/Cambridge_Bay", + "America/Campo_Grande", + "America/Cancun", + "America/Caracas", + "America/Catamarca", + "America/Cayenne", + "America/Cayman", + "America/Chicago", + "America/Chihuahua", + "America/Coral_Harbour", + "America/Cordoba", + "America/Costa_Rica", + "America/Creston", + "America/Cuiaba", + "America/Curacao", + "America/Danmarkshavn", + "America/Dawson", + "America/Dawson_Creek", + "America/Denver", + "America/Detroit", + "America/Dominica", + "America/Edmonton", + "America/Eirunepe", + "America/El_Salvador", + "America/Ensenada", + "America/Fort_Nelson", + "America/Fort_Wayne", + "America/Fortaleza", + "America/Glace_Bay", + "America/Godthab", + "America/Goose_Bay", + "America/Grand_Turk", + "America/Grenada", + "America/Guadeloupe", + "America/Guatemala", + "America/Guayaquil", + "America/Guyana", + "America/Halifax", + "America/Havana", + "America/Hermosillo", + "America/Indiana/Indianapolis", + "America/Indiana/Knox", + "America/Indiana/Marengo", + "America/Indiana/Petersburg", + "America/Indiana/Tell_City", + "America/Indiana/Vevay", + "America/Indiana/Vincennes", + "America/Indiana/Winamac", + "America/Indianapolis", + "America/Inuvik", + "America/Iqaluit", + "America/Jamaica", + "America/Jujuy", + "America/Juneau", + "America/Kentucky/Louisville", + "America/Kentucky/Monticello", + "America/Knox_IN", + "America/Kralendijk", + "America/La_Paz", + "America/Lima", + "America/Los_Angeles", + "America/Louisville", + "America/Lower_Princes", + "America/Maceio", + "America/Managua", + "America/Manaus", + "America/Marigot", + "America/Martinique", + "America/Matamoros", + "America/Mazatlan", + "America/Mendoza", + "America/Menominee", + "America/Merida", + "America/Metlakatla", + "America/Mexico_City", + "America/Miquelon", + "America/Moncton", + "America/Monterrey", + "America/Montevideo", + "America/Montreal", + "America/Montserrat", + "America/Nassau", + "America/New_York", + "America/Nipigon", + "America/Nome", + "America/Noronha", + "America/North_Dakota/Beulah", + "America/North_Dakota/Center", + "America/North_Dakota/New_Salem", + "America/Nuuk", + "America/Ojinaga", + "America/Panama", + "America/Pangnirtung", + "America/Paramaribo", + "America/Phoenix", + "America/Port-au-Prince", + "America/Port_of_Spain", + "America/Porto_Acre", + "America/Porto_Velho", + "America/Puerto_Rico", + "America/Punta_Arenas", + "America/Rainy_River", + "America/Rankin_Inlet", + "America/Recife", + "America/Regina", + "America/Resolute", + "America/Rio_Branco", + "America/Rosario", + "America/Santa_Isabel", + "America/Santarem", + "America/Santiago", + "America/Santo_Domingo", + "America/Sao_Paulo", + "America/Scoresbysund", + "America/Shiprock", + "America/Sitka", + "America/St_Barthelemy", + "America/St_Johns", + "America/St_Kitts", + "America/St_Lucia", + "America/St_Thomas", + "America/St_Vincent", + "America/Swift_Current", + "America/Tegucigalpa", + "America/Thule", + "America/Thunder_Bay", + "America/Tijuana", + "America/Toronto", + "America/Tortola", + "America/Vancouver", + "America/Virgin", + "America/Whitehorse", + "America/Winnipeg", + "America/Yakutat", + "America/Yellowknife", + "Antarctica/Casey", + "Antarctica/Davis", + "Antarctica/DumontDUrville", + "Antarctica/Macquarie", + "Antarctica/Mawson", + "Antarctica/McMurdo", + "Antarctica/Palmer", + "Antarctica/Rothera", + "Antarctica/South_Pole", + "Antarctica/Syowa", + "Antarctica/Troll", + "Antarctica/Vostok", + "Arctic/Longyearbyen", + "Asia/Aden", + "Asia/Almaty", + "Asia/Amman", + "Asia/Anadyr", + "Asia/Aqtau", + "Asia/Aqtobe", + "Asia/Ashgabat", + "Asia/Ashkhabad", + "Asia/Atyrau", + "Asia/Baghdad", + "Asia/Bahrain", + "Asia/Baku", + "Asia/Bangkok", + "Asia/Barnaul", + "Asia/Beirut", + "Asia/Bishkek", + "Asia/Brunei", + "Asia/Calcutta", + "Asia/Chita", + "Asia/Choibalsan", + "Asia/Chongqing", + "Asia/Chungking", + "Asia/Colombo", + "Asia/Dacca", + "Asia/Damascus", + "Asia/Dhaka", + "Asia/Dili", + "Asia/Dubai", + "Asia/Dushanbe", + "Asia/Famagusta", + "Asia/Gaza", + "Asia/Harbin", + "Asia/Hebron", + "Asia/Ho_Chi_Minh", + "Asia/Hong_Kong", + "Asia/Hovd", + "Asia/Irkutsk", + "Asia/Istanbul", + "Asia/Jakarta", + "Asia/Jayapura", + "Asia/Jerusalem", + "Asia/Kabul", + "Asia/Kamchatka", + "Asia/Karachi", + "Asia/Kashgar", + "Asia/Kathmandu", + "Asia/Katmandu", + "Asia/Khandyga", + "Asia/Kolkata", + "Asia/Krasnoyarsk", + "Asia/Kuala_Lumpur", + "Asia/Kuching", + "Asia/Kuwait", + "Asia/Macao", + "Asia/Macau", + "Asia/Magadan", + "Asia/Makassar", + "Asia/Manila", + "Asia/Muscat", + "Asia/Nicosia", + "Asia/Novokuznetsk", + "Asia/Novosibirsk", + "Asia/Omsk", + "Asia/Oral", + "Asia/Phnom_Penh", + "Asia/Pontianak", + "Asia/Pyongyang", + "Asia/Qatar", + "Asia/Qostanay", + "Asia/Qyzylorda", + "Asia/Rangoon", + "Asia/Riyadh", + "Asia/Saigon", + "Asia/Sakhalin", + "Asia/Samarkand", + "Asia/Seoul", + "Asia/Shanghai", + "Asia/Singapore", + "Asia/Srednekolymsk", + "Asia/Taipei", + "Asia/Tashkent", + "Asia/Tbilisi", + "Asia/Tehran", + "Asia/Tel_Aviv", + "Asia/Thimbu", + "Asia/Thimphu", + "Asia/Tokyo", + "Asia/Tomsk", + "Asia/Ujung_Pandang", + "Asia/Ulaanbaatar", + "Asia/Ulan_Bator", + "Asia/Urumqi", + "Asia/Ust-Nera", + "Asia/Vientiane", + "Asia/Vladivostok", + "Asia/Yakutsk", + "Asia/Yangon", + "Asia/Yekaterinburg", + "Asia/Yerevan", + "Atlantic/Azores", + "Atlantic/Bermuda", + "Atlantic/Canary", + "Atlantic/Cape_Verde", + "Atlantic/Faeroe", + "Atlantic/Faroe", + "Atlantic/Jan_Mayen", + "Atlantic/Madeira", + "Atlantic/Reykjavik", + "Atlantic/South_Georgia", + "Atlantic/St_Helena", + "Atlantic/Stanley", + "Australia/ACT", + "Australia/Adelaide", + "Australia/Brisbane", + "Australia/Broken_Hill", + "Australia/Canberra", + "Australia/Currie", + "Australia/Darwin", + "Australia/Eucla", + "Australia/Hobart", + "Australia/LHI", + "Australia/Lindeman", + "Australia/Lord_Howe", + "Australia/Melbourne", + "Australia/North", + "Australia/NSW", + "Australia/Perth", + "Australia/Queensland", + "Australia/South", + "Australia/Sydney", + "Australia/Tasmania", + "Australia/Victoria", + "Australia/West", + "Australia/Yancowinna", + "Brazil/Acre", + "Brazil/DeNoronha", + "Brazil/East", + "Brazil/West", + "Canada/Atlantic", + "Canada/Central", + "Canada/Eastern", + "Canada/Mountain", + "Canada/Newfoundland", + "Canada/Pacific", + "Canada/Saskatchewan", + "Canada/Yukon", + "Chile/Continental", + "Chile/EasterIsland", + "Cuba", + "Egypt", + "Eire", + "Etc/GMT", + "Etc/GMT+0", + "Etc/GMT+1", + "Etc/GMT+10", + "Etc/GMT+11", + "Etc/GMT+12", + "Etc/GMT+2", + "Etc/GMT+3", + "Etc/GMT+4", + "Etc/GMT+5", + "Etc/GMT+6", + "Etc/GMT+7", + "Etc/GMT+8", + "Etc/GMT+9", + "Etc/GMT-0", + "Etc/GMT-1", + "Etc/GMT-10", + "Etc/GMT-11", + "Etc/GMT-12", + "Etc/GMT-13", + "Etc/GMT-14", + "Etc/GMT-2", + "Etc/GMT-3", + "Etc/GMT-4", + "Etc/GMT-5", + "Etc/GMT-6", + "Etc/GMT-7", + "Etc/GMT-8", + "Etc/GMT-9", + "Etc/GMT0", + "Etc/Greenwich", + "Etc/UCT", + "Etc/Universal", + "Etc/UTC", + "Etc/Zulu", + "Europe/Amsterdam", + "Europe/Andorra", + "Europe/Astrakhan", + "Europe/Athens", + "Europe/Belfast", + "Europe/Belgrade", + "Europe/Berlin", + "Europe/Bratislava", + "Europe/Brussels", + "Europe/Bucharest", + "Europe/Budapest", + "Europe/Busingen", + "Europe/Chisinau", + "Europe/Copenhagen", + "Europe/Dublin", + "Europe/Gibraltar", + "Europe/Guernsey", + "Europe/Helsinki", + "Europe/Isle_of_Man", + "Europe/Istanbul", + "Europe/Jersey", + "Europe/Kaliningrad", + "Europe/Kiev", + "Europe/Kirov", + "Europe/Lisbon", + "Europe/Ljubljana", + "Europe/London", + "Europe/Luxembourg", + "Europe/Madrid", + "Europe/Malta", + "Europe/Mariehamn", + "Europe/Minsk", + "Europe/Monaco", + "Europe/Moscow", + "Europe/Nicosia", + "Europe/Oslo", + "Europe/Paris", + "Europe/Podgorica", + "Europe/Prague", + "Europe/Riga", + "Europe/Rome", + "Europe/Samara", + "Europe/San_Marino", + "Europe/Sarajevo", + "Europe/Saratov", + "Europe/Simferopol", + "Europe/Skopje", + "Europe/Sofia", + "Europe/Stockholm", + "Europe/Tallinn", + "Europe/Tirane", + "Europe/Tiraspol", + "Europe/Ulyanovsk", + "Europe/Uzhgorod", + "Europe/Vaduz", + "Europe/Vatican", + "Europe/Vienna", + "Europe/Vilnius", + "Europe/Volgograd", + "Europe/Warsaw", + "Europe/Zagreb", + "Europe/Zaporozhye", + "Europe/Zurich", + "GB", + "GB-Eire", + "Hongkong", + "Iceland", + "Indian/Antananarivo", + "Indian/Chagos", + "Indian/Christmas", + "Indian/Cocos", + "Indian/Comoro", + "Indian/Kerguelen", + "Indian/Mahe", + "Indian/Maldives", + "Indian/Mauritius", + "Indian/Mayotte", + "Indian/Reunion", + "Iran", + "Israel", + "Jamaica", + "Japan", + "Kwajalein", + "Libya", + "Mexico/BajaNorte", + "Mexico/BajaSur", + "Mexico/General", + "Navajo", + "NZ", + "NZ-CHAT", + "Pacific/Apia", + "Pacific/Auckland", + "Pacific/Bougainville", + "Pacific/Chatham", + "Pacific/Chuuk", + "Pacific/Easter", + "Pacific/Efate", + "Pacific/Enderbury", + "Pacific/Fakaofo", + "Pacific/Fiji", + "Pacific/Funafuti", + "Pacific/Galapagos", + "Pacific/Gambier", + "Pacific/Guadalcanal", + "Pacific/Guam", + "Pacific/Honolulu", + "Pacific/Johnston", + "Pacific/Kanton", + "Pacific/Kiritimati", + "Pacific/Kosrae", + "Pacific/Kwajalein", + "Pacific/Majuro", + "Pacific/Marquesas", + "Pacific/Midway", + "Pacific/Nauru", + "Pacific/Niue", + "Pacific/Norfolk", + "Pacific/Noumea", + "Pacific/Pago_Pago", + "Pacific/Palau", + "Pacific/Pitcairn", + "Pacific/Pohnpei", + "Pacific/Ponape", + "Pacific/Port_Moresby", + "Pacific/Rarotonga", + "Pacific/Saipan", + "Pacific/Samoa", + "Pacific/Tahiti", + "Pacific/Tarawa", + "Pacific/Tongatapu", + "Pacific/Truk", + "Pacific/Wake", + "Pacific/Wallis", + "Pacific/Yap", + "Poland", + "Portugal", + "PRC", + "ROC", + "Singapore", + "US/Alaska", + "US/Aleutian", + "US/Arizona", + "US/Central", + "US/East-Indiana", + "US/Eastern", + "US/Hawaii", + "US/Indiana-Starke", + "US/Michigan", + "US/Mountain", + "US/Pacific", + "US/Samoa" + ] + }, + "dependency-type": { + "type": "string", + "enum": ["direct", "indirect", "all", "production", "development"], + "x-intellij-enum-metadata": { + "direct": { + "description": "All explicitly defined dependencies." + }, + "indirect": { + "description": "Dependencies of direct dependencies (also known as sub-dependencies, or transient dependencies)." + }, + "all": { + "description": "All explicitly defined dependencies. For bundler, pip, composer, cargo, also the dependencies of direct dependencies." + }, + "production": { + "description": "Only dependencies in the 'Product dependency group'." + }, + "development": { + "description": "Only dependencies in the 'Development dependency group'." + } + } + }, + "update-types": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "version-update:semver-major", + "version-update:semver-minor", + "version-update:semver-patch" + ] + }, + "minItems": 1, + "uniqueItems": true + }, + "insecure-external-code-execution": { + "type": "string", + "enum": ["allow", "deny"] + }, + "versioning-strategy": { + "type": "string", + "enum": [ + "auto", + "increase", + "increase-if-necessary", + "lockfile-only", + "widen" + ], + "x-intellij-enum-metadata": { + "auto": { + "description": "Try to differentiate between apps and libraries. Use 'increase' for apps and 'widen' for libraries." + }, + "increase": { + "description": "Always increase the minimum version requirement to match the new version. If a range already exists, typically this only increases the lower bound." + }, + "increase-if-necessary": { + "description": "Leave the constraint if the original constraint allows the new version, otherwise, bump the constraint." + }, + "lockfile-only": { + "description": "Only create pull requests to update lockfiles. Ignore any new versions that would require package manifest changes." + }, + "widen": { + "description": "Widen the allowed version requirements to include both the new and old versions, when possible. Typically, this only increases the maximum allowed version requirement." + } + } + }, + "package-ecosystem-values": { + "enum": [ + "bundler", + "cargo", + "composer", + "docker", + "elm", + "gitsubmodule", + "github-actions", + "gomod", + "gradle", + "maven", + "mix", + "npm", + "nuget", + "pip", + "pub", + "swift", + "terraform" + ] + }, + "schedule-day": { + "type": "string", + "enum": [ + "monday", + "tuesday", + "wednesday", + "thursday", + "friday", + "saturday", + "sunday" + ] + }, + "schedule-interval": { + "type": "string", + "enum": ["daily", "weekly", "monthly"] + }, + "update": { + "type": "object", + "properties": { + "allow": { + "description": "Customize which updates are allowed", + "type": "array", + "items": { + "type": "object", + "properties": { + "dependency-name": { + "type": "string" + }, + "dependency-type": { + "$ref": "#/definitions/dependency-type" + } + }, + "anyOf": [ + { "required": ["dependency-name"] }, + { "required": ["dependency-type"] } + ], + "additionalProperties": false + } + }, + "assignees": { + "description": "Assignees to set on pull requests", + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "minItems": 1, + "uniqueItems": true + }, + "commit-message": { + "description": "Dependabot attempts to detect your commit message preferences and use similar patterns. Use this option to specify your preferences explicitly.", + "type": "object", + "properties": { + "prefix": { + "description": "A prefix for all commit messages. When you specify a prefix for commit messages, GitHub will automatically add a colon between the defined prefix and the commit message provided the defined prefix ends with a letter, number, closing parenthesis, or closing bracket. This means that, for example, if you end the prefix with a whitespace, there will be no colon added between the prefix and the commit message.", + "type": "string", + "maxLength": 50 + }, + "prefix-development": { + "description": "A separate prefix for all commit messages that update dependencies in the Development dependency group. When you specify a value for this option, the prefix is used only for updates to dependencies in the Production dependency group. This is not supported by all package ecosystems.", + "type": "string", + "maxLength": 50 + }, + "include": { + "description": "Specifies that any prefix is followed by a list of the dependencies updated in the commit.", + "type": "string", + "enum": ["scope"], + "default": "scope" + } + }, + "anyOf": [ + { "required": ["prefix"] }, + { "required": ["prefix-development"] }, + { "required": ["include"] } + ], + "additionalProperties": false + }, + "directory": { + "description": "Location of package manifests", + "type": "string", + "default": "/" + }, + "groups": { + "description": "Configure groups for dependencies. Each 'groups' property is arbitrary will appear in pull request titles and branch names. For example, the code snippet '{\"groups\": {\"NPM dependencies\": {\"patterns\": [\"*\"]}}}' sets the group name to 'NPM dependencies'.", + "type": "object", + "patternProperties": { + "^.+$": { + "type": "object", + "properties": { + "dependency-type": { + "description": "Specify a dependency type to be included in the group.", + "type": "string", + "enum": ["development", "production"] + }, + "patterns": { + "description": "Define strings of characters that match with a dependency name (or multiple dependency names) to include those dependencies in the group.", + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "uniqueItems": true, + "minItems": 1 + }, + "exclude-patterns": { + "description": "Exclude certain dependencies from the group. If a dependency is excluded from a group, Dependabot will continue to raise single pull requests to update the dependency to its latest version.", + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "uniqueItems": true, + "minItems": 1 + }, + "update-types": { + "description": "Specify the semantic versioning level to include in the group", + "type": "array", + "items": { + "type": "string", + "enum": ["major", "minor", "patch"] + }, + "minItems": 1, + "uniqueItems": true + } + }, + "anyOf": [ + { "required": ["dependency-type"] }, + { "required": ["patterns"] }, + { "required": ["update-types"] } + ], + "additionalProperties": false + } + }, + "additionalProperties": false, + "minProperties": 1 + }, + "ignore": { + "description": "Ignore certain dependencies or versions", + "type": "array", + "items": { + "type": "object", + "properties": { + "dependency-name": { + "description": "Use to ignore updates for dependencies with matching names, optionally using * to match zero or more characters.", + "type": "string" + }, + "update-types": { + "description": "Use to ignore types of updates. You can combine this with 'dependency-name: \"*\"' to ignore particular update-types for all dependencies.", + "$ref": "#/definitions/update-types" + }, + "versions": { + "description": "Use to ignore specific versions or ranges of versions. If you want to define a range, use the standard pattern for the package manager.", + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1, + "uniqueItems": true + } + }, + "anyOf": [ + { "required": ["dependency-name"] }, + { "required": ["update-types"] }, + { "required": ["versions"] } + ], + "additionalProperties": false + } + }, + "insecure-external-code-execution": { + "description": "Allow or deny code execution in manifest files", + "$ref": "#/definitions/insecure-external-code-execution" + }, + "labels": { + "description": "Labels to set on pull requests", + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "minItems": 0, + "uniqueItems": true, + "default": ["dependencies"] + }, + "milestone": { + "description": "Associate all pull requests raised for a package manager with a milestone. You need to specify the numeric identifier of the milestone and not its label.", + "type": "integer", + "minimum": 1 + }, + "open-pull-requests-limit": { + "description": "Limit number of open pull requests for version updates", + "type": "integer", + "minimum": 0, + "default": 5 + }, + "package-ecosystem": { + "description": "Package manager to use", + "$comment": "These values are restricted by a top-level if-then-else when 'enable-beta-ecosystems' is not enabled.", + "type": "string", + "anyOf": [ + { "$ref": "#/definitions/package-ecosystem-values" }, + { "minLength": 1 } + ] + }, + "pull-request-branch-name": { + "description": "Pull request branch name preferences", + "type": "object", + "properties": { + "separator": { + "description": "Change separator for PR branch name", + "type": "string", + "default": "/", + "enum": ["-", "_", "/"] + } + }, + "required": ["separator"], + "additionalProperties": false + }, + "rebase-strategy": { + "description": "Disable automatic rebasing. 'auto' is the default and Dependabot will rebase open pull requests when changes are detected. 'disabled' will disable automatic rebasing.", + "type": "string", + "enum": ["auto", "disabled"], + "default": "auto" + }, + "registries": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "uniqueItems": true, + "minItems": 1 + }, + "reviewers": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "description": "Specify individual reviewers or teams of reviewers for all pull requests raised for a package manager. You must use the full team name, including the organization, as if you were @mentioning the team.", + "minItems": 1, + "uniqueItems": true + }, + "schedule": { + "description": "Schedule preferences", + "type": "object", + "properties": { + "interval": { + "$ref": "#/definitions/schedule-interval" + }, + "day": { + "$ref": "#/definitions/schedule-day", + "description": "Specify an alternative day to check for updates" + }, + "time": { + "type": "string", + "description": "Specify an alternative time of day to check for updates (format: hh:mm)", + "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$" + }, + "timezone": { + "$ref": "#/definitions/timezone", + "description": "The time zone identifier must be from the Time Zone database maintained by IANA" + } + }, + "required": ["interval"] + }, + "target-branch": { + "description": "Specify a different branch for manifest files and for pull requests.", + "type": "string", + "minLength": 1 + }, + "vendor": { + "description": "Tell Dependabot to vendor dependencies when updating them. Don't use this option if you're using 'gomod'.", + "type": "boolean" + }, + "versioning-strategy": { + "description": "How to update manifest version requirements", + "$ref": "#/definitions/versioning-strategy" + } + }, + "required": ["package-ecosystem", "directory", "schedule"] + }, + "registry": { + "type": "object", + "description": "The top-level registries key is optional. It allows you to specify authentication details that Dependabot can use to access private package registries.", + "additionalProperties": false, + "patternProperties": { + ".+": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "description": "Identifies the type of registry.", + "enum": [ + "composer-repository", + "docker-registry", + "git", + "hex-organization", + "hex-repository", + "maven-repository", + "npm-registry", + "nuget-feed", + "python-index", + "rubygems-server", + "terraform-registry" + ] + }, + "url": { + "description": "The URL to use to access the dependencies in this registry. The protocol is optional. If not specified, 'https://' is assumed. Dependabot adds or ignores trailing slashes as required.", + "type": "string" + }, + "username": { + "description": "The username that Dependabot uses to access the registry.", + "type": "string" + }, + "password": { + "description": "A reference to a Dependabot secret containing the password for the specified user.", + "type": "string" + }, + "key": { + "description": "A reference to a Dependabot secret containing an access key for this registry.", + "type": "string" + }, + "token": { + "description": "A reference to a Dependabot secret containing an access token for this registry.", + "type": "string" + }, + "replaces-base": { + "description": "For registries with type: python-index, if the boolean value is true, pip resolves dependencies by using the specified URL rather than the base URL of the Python Package Index (by default https://pypi.org/simple).", + "type": "boolean" + }, + "organization": { + "description": "", + "type": "string" + }, + "repo": { + "description": "", + "type": "string" + }, + "auth-key": { + "description": "", + "type": "string" + }, + "public-key-fingerprint": { + "description": "", + "type": "string" + } + }, + "required": ["type", "url"] + } + }, + "minProperties": 1 + } + }, + "properties": { + "version": { + "title": "Config file version", + "description": "Dependabot configuration files require this key, and its value must be 2", + "type": "integer", + "enum": [2] + }, + "enable-beta-ecosystems": { + "description": "Enable ecosystems that have beta-level support", + "type": "boolean" + }, + "updates": { + "type": "array", + "items": { + "title": "Package Ecosystem", + "description": "Element for each one package manager that you want GitHub Dependabot to monitor for new versions", + "$ref": "#/definitions/update" + } + }, + "registries": { + "$ref": "#/definitions/registry" + } + }, + "required": ["version", "updates"], + "title": "GitHub Dependabot v2 config", + "type": "object", + "allOf": [ + { + "$comment": "If 'enable-beta-ecosystems' is NOT enabled, enforce known 'package-ecosystem' values.", + "if": { + "properties": { + "enable-beta-ecosystems": { + "const": true + } + }, + "required": ["enable-beta-ecosystems"] + }, + "then": {}, + "else": { + "properties": { + "updates": { + "items": { + "properties": { + "package-ecosystem": { + "$ref": "#/definitions/package-ecosystem-values" + } + } + } + } + } + } + } + ] +} diff --git a/src/main/resources/schemas/github-action.json b/src/main/resources/schemas/github-action.json index e6eb9ff..96d3a93 100644 --- a/src/main/resources/schemas/github-action.json +++ b/src/main/resources/schemas/github-action.json @@ -1,677 +1,677 @@ -{ - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions", - "$id": "https://json.schemastore.org/github-action.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { - "expressionSyntax": { - "type": "string", - "$comment": "escape `{` and `}` in pattern to be unicode compatible (#1360)", - "pattern": "^\\$\\{\\{(.|[\r\n])*\\}\\}$" - }, - "stringContainingExpressionSyntax": { - "type": "string", - "$comment": "escape `{` and `}` in pattern to be unicode compatible (#1360)", - "pattern": "^.*\\$\\{\\{(.|[\r\n])*\\}\\}.*$" - }, - "pre-if": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#pre-if", - "description": "Allows you to define conditions for the `pre:` action execution. The `pre:` action will only run if the conditions in `pre-if` are met. If not set, then `pre-if` defaults to `always()`. Note that the `step` context is unavailable, as no steps have run yet.", - "type": "string" - }, - "post-if": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#post-if", - "description": "Allows you to define conditions for the `post:` action execution. The `post:` action will only run if the conditions in `post-if` are met. If not set, then `post-if` defaults to `always()`.", - "type": "string" - }, - "runs-javascript": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-javascript-actions", - "description": "Configures the path to the action's code and the application used to execute the code.", - "type": "object", - "properties": { - "using": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsusing", - "description": "The application used to execute the code specified in `main`.", - "enum": ["node12", "node16", "node20"] - }, - "main": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsmain", - "description": "The file that contains your action code. The application specified in `using` executes this file.", - "type": "string" - }, - "pre": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#pre", - "description": "Allows you to run a script at the start of a job, before the `main:` action begins. For example, you can use `pre:` to run a prerequisite setup script. The application specified with the `using` syntax will execute this file. The `pre:` action always runs by default but you can override this using `pre-if`.", - "type": "string" - }, - "pre-if": { - "$ref": "#/definitions/pre-if" - }, - "post": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#post", - "description": "Allows you to run a script at the end of a job, once the `main:` action has completed. For example, you can use `post:` to terminate certain processes or remove unneeded files. The application specified with the `using` syntax will execute this file. The `post:` action always runs by default but you can override this using `post-if`.", - "type": "string" - }, - "post-if": { - "$ref": "#/definitions/post-if" - } - }, - "required": ["using", "main"], - "additionalProperties": false - }, - "runs-composite": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-composite-run-steps-actions", - "description": "Configures the path to the composite action, and the application used to execute the code.", - "type": "object", - "properties": { - "using": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsusing-1", - "description": "To use a composite run steps action, set this to 'composite'.", - "const": "composite" - }, - "steps": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runssteps", - "description": "The run steps that you plan to run in this action.", - "type": "array", - "items": { - "type": "object", - "properties": { - "run": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsrun", - "description": "The command you want to run. This can be inline or a script in your action repository.", - "type": "string" - }, - "shell": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsshell", - "description": "The shell where you want to run the command.", - "type": "string", - "anyOf": [ - { - "$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#custom-shell" - }, - { - "enum": [ - "bash", - "pwsh", - "python", - "sh", - "cmd", - "powershell" - ] - } - ] - }, - "uses": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsuses", - "description": "Selects an action to run as part of a step in your job.", - "type": "string" - }, - "with": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsstepswith", - "description": "A map of the input parameters defined by the action. Each input parameter is a key/value pair. Input parameters are set as environment variables. The variable is prefixed with INPUT_ and converted to upper case.", - "type": "object" - }, - "name": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsname", - "description": "The name of the composite run step.", - "type": "string" - }, - "id": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsid", - "description": "A unique identifier for the step. You can use the `id` to reference the step in contexts.", - "type": "string" - }, - "if": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsif", - "description": "You can use the if conditional to prevent a step from running unless a condition is met. You can use any supported context and expression to create a conditional.\nExpressions in an if conditional do not require the ${{ }} syntax. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.", - "type": "string" - }, - "env": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsenv", - "description": "Sets a map of environment variables for only that step.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "continue-on-error": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error", - "description": "Prevents a job from failing when a step fails. Set to true to allow a job to pass when this step fails.", - "oneOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/expressionSyntax" - } - ], - "default": false - }, - "working-directory": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsworking-directory", - "description": "Specifies the working directory where the command is run.", - "type": "string" - } - }, - "oneOf": [ - { - "required": ["run", "shell"] - }, - { - "required": ["uses"] - } - ], - "additionalProperties": false - } - } - }, - "required": ["using", "steps"], - "additionalProperties": false - }, - "runs-docker": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-docker-actions", - "description": "Configures the image used for the Docker action.", - "type": "object", - "properties": { - "using": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsusing-2", - "description": "You must set this value to 'docker'.", - "const": "docker" - }, - "image": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsimage", - "description": "The Docker image to use as the container to run the action. The value can be the Docker base image name, a local `Dockerfile` in your repository, or a public image in Docker Hub or another registry. To reference a `Dockerfile` local to your repository, use a path relative to your action metadata file. The `docker` application will execute this file.", - "type": "string" - }, - "env": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsenv", - "description": "Specifies a key/value map of environment variables to set in the container environment.", - "oneOf": [ - { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "boolean" - } - ] - } - }, - { - "$ref": "#/definitions/stringContainingExpressionSyntax" - } - ] - }, - "entrypoint": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsentrypoint", - "description": "Overrides the Docker `ENTRYPOINT` in the `Dockerfile`, or sets it if one wasn't already specified. Use `entrypoint` when the `Dockerfile` does not specify an `ENTRYPOINT` or you want to override the `ENTRYPOINT` instruction. If you omit `entrypoint`, the commands you specify in the Docker `ENTRYPOINT` instruction will execute. The Docker `ENTRYPOINT instruction has a *shell* form and *exec* form. The Docker `ENTRYPOINT` documentation recommends using the *exec* form of the `ENTRYPOINT` instruction.", - "type": "string" - }, - "pre-entrypoint": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#pre-entrypoint", - "description": "Allows you to run a script before the `entrypoint` action begins. For example, you can use `pre-entrypoint:` to run a prerequisite setup script. GitHub Actions uses `docker run` to launch this action, and runs the script inside a new container that uses the same base image. This means that the runtime state is different from the main `entrypoint` container, and any states you require must be accessed in either the workspace, `HOME`, or as a `STATE_` variable. The `pre-entrypoint:` action always runs by default but you can override this using `pre-if`.", - "type": "string" - }, - "pre-if": { - "$ref": "#/definitions/pre-if" - }, - "post-entrypoint": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#post-entrypoint", - "description": "Allows you to run a cleanup script once the `runs.entrypoint` action has completed. GitHub Actions uses `docker run` to launch this action. Because GitHub Actions runs the script inside a new container using the same base image, the runtime state is different from the main `entrypoint` container. You can access any state you need in either the workspace, `HOME`, or as a `STATE_` variable. The `post-entrypoint:` action always runs by default but you can override this using `post-if`.", - "type": "string" - }, - "post-if": { - "$ref": "#/definitions/post-if" - }, - "args": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsargs", - "description": "An array of strings that define the inputs for a Docker container. Inputs can include hardcoded strings. GitHub passes the `args` to the container's `ENTRYPOINT` when the container starts up.\nThe `args` are used in place of the `CMD` instruction in a `Dockerfile`. If you use `CMD` in your `Dockerfile`, use the guidelines ordered by preference:\n- Document required arguments in the action's README and omit them from the `CMD` instruction.\n- Use defaults that allow using the action without specifying any `args`.\n- If the action exposes a `--help` flag, or something similar, use that to make your action self-documenting.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["using", "image"], - "additionalProperties": false - }, - "outputs": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#outputs", - "description": "Output parameters allow you to declare data that an action sets. Actions that run later in a workflow can use the output data set in previously run actions. For example, if you had an action that performed the addition of two inputs (x + y = z), the action could output the sum (z) for other actions to use as an input.\nIf you don't declare an output in your action metadata file, you can still set outputs and use them in a workflow.", - "type": "object", - "patternProperties": { - "^[_a-zA-Z][a-zA-Z0-9_-]*$": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#outputsoutput_id", - "description": "A string identifier to associate with the output. The value of `` is a map of the output's metadata. The `` must be a unique identifier within the outputs object. The `` must start with a letter or `_` and contain only alphanumeric characters, `-`, or `_`.", - "type": "object", - "properties": { - "description": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#outputsoutput_iddescription", - "description": "A string description of the output parameter.", - "type": "string" - } - }, - "required": ["description"], - "additionalProperties": false - } - }, - "additionalProperties": false - }, - "outputs-composite": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#outputs-for-composite-run-steps-actions", - "description": "Output parameters allow you to declare data that an action sets. Actions that run later in a workflow can use the output data set in previously run actions. For example, if you had an action that performed the addition of two inputs (x + y = z), the action could output the sum (z) for other actions to use as an input.\nIf you don't declare an output in your action metadata file, you can still set outputs and use them in a workflow.", - "type": "object", - "patternProperties": { - "^[_a-zA-Z][a-zA-Z0-9_-]*$": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#outputsoutput_id", - "description": "A string identifier to associate with the output. The value of `` is a map of the output's metadata. The `` must be a unique identifier within the outputs object. The `` must start with a letter or `_` and contain only alphanumeric characters, `-`, or `_`.", - "type": "object", - "properties": { - "description": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#outputsoutput_iddescription", - "description": "A string description of the output parameter.", - "type": "string" - }, - "value": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#outputsoutput_idvalue", - "description": "The value that the output parameter will be mapped to. You can set this to a string or an expression with context. For example, you can use the steps context to set the value of an output to the output value of a step.", - "type": "string" - } - }, - "required": ["description", "value"], - "additionalProperties": false - } - }, - "additionalProperties": false - } - }, - "else": { - "properties": { - "outputs": { - "$ref": "#/definitions/outputs" - } - } - }, - "if": { - "properties": { - "runs": { - "properties": { - "using": { - "const": "composite" - } - } - } - } - }, - "properties": { - "name": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#name", - "description": "The name of your action. GitHub displays the `name` in the Actions tab to help visually identify actions in each job.", - "type": "string" - }, - "author": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#author", - "description": "The name of the action's author.", - "type": "string" - }, - "description": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#description", - "description": "A short description of the action.", - "type": "string" - }, - "inputs": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputs", - "description": "Input parameters allow you to specify data that the action expects to use during runtime. GitHub stores input parameters as environment variables. Input ids with uppercase letters are converted to lowercase during runtime. We recommended using lowercase input ids.", - "type": "object", - "patternProperties": { - "^[_a-zA-Z][a-zA-Z0-9_-]*$": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputsinput_id", - "description": "A string identifier to associate with the input. The value of `` is a map of the input's metadata. The `` must be a unique identifier within the inputs object. The `` must start with a letter or `_` and contain only alphanumeric characters, `-`, or `_`.", - "type": "object", - "properties": { - "description": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputsinput_iddescription", - "description": "A string description of the input parameter.", - "type": "string" - }, - "deprecationMessage": { - "description": "A string shown to users using the deprecated input.", - "type": "string" - }, - "required": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputsinput_idrequired", - "description": "A boolean to indicate whether the action requires the input parameter. Set to `true` when the parameter is required.", - "type": "boolean" - }, - "default": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputsinput_iddefault", - "description": "A string representing the default value. The default value is used when an input parameter isn't specified in a workflow file.", - "type": "string" - } - }, - "required": ["description"], - "additionalProperties": false - } - }, - "additionalProperties": false - }, - "outputs": { - "$comment": "Because of `additionalProperties: false`, this empty schema is needed to allow the `outputs` property. The `outputs` subschema is determined by the if/then/else keywords." - }, - "runs": { - "oneOf": [ - { - "$ref": "#/definitions/runs-javascript" - }, - { - "$ref": "#/definitions/runs-composite" - }, - { - "$ref": "#/definitions/runs-docker" - } - ] - }, - "branding": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#branding", - "description": "You can use a color and Feather icon to create a badge to personalize and distinguish your action. Badges are shown next to your action name in GitHub Marketplace.", - "type": "object", - "properties": { - "color": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#brandingcolor", - "description": "The background color of the badge.", - "type": "string", - "enum": [ - "white", - "yellow", - "blue", - "green", - "orange", - "red", - "purple", - "gray-dark" - ] - }, - "icon": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#brandingicon", - "description": "The name of the Feather icon to use.", - "type": "string", - "enum": [ - "activity", - "airplay", - "alert-circle", - "alert-octagon", - "alert-triangle", - "align-center", - "align-justify", - "align-left", - "align-right", - "anchor", - "aperture", - "archive", - "arrow-down-circle", - "arrow-down-left", - "arrow-down-right", - "arrow-down", - "arrow-left-circle", - "arrow-left", - "arrow-right-circle", - "arrow-right", - "arrow-up-circle", - "arrow-up-left", - "arrow-up-right", - "arrow-up", - "at-sign", - "award", - "bar-chart-2", - "bar-chart", - "battery-charging", - "battery", - "bell-off", - "bell", - "bluetooth", - "bold", - "book-open", - "book", - "bookmark", - "box", - "briefcase", - "calendar", - "camera-off", - "camera", - "cast", - "check-circle", - "check-square", - "check", - "chevron-down", - "chevron-left", - "chevron-right", - "chevron-up", - "chevrons-down", - "chevrons-left", - "chevrons-right", - "chevrons-up", - "circle", - "clipboard", - "clock", - "cloud-drizzle", - "cloud-lightning", - "cloud-off", - "cloud-rain", - "cloud-snow", - "cloud", - "code", - "command", - "compass", - "copy", - "corner-down-left", - "corner-down-right", - "corner-left-down", - "corner-left-up", - "corner-right-down", - "corner-right-up", - "corner-up-left", - "corner-up-right", - "cpu", - "credit-card", - "crop", - "crosshair", - "database", - "delete", - "disc", - "dollar-sign", - "download-cloud", - "download", - "droplet", - "edit-2", - "edit-3", - "edit", - "external-link", - "eye-off", - "eye", - "facebook", - "fast-forward", - "feather", - "file-minus", - "file-plus", - "file-text", - "file", - "film", - "filter", - "flag", - "folder-minus", - "folder-plus", - "folder", - "gift", - "git-branch", - "git-commit", - "git-merge", - "git-pull-request", - "globe", - "grid", - "hard-drive", - "hash", - "headphones", - "heart", - "help-circle", - "home", - "image", - "inbox", - "info", - "italic", - "layers", - "layout", - "life-buoy", - "link-2", - "link", - "list", - "loader", - "lock", - "log-in", - "log-out", - "mail", - "map-pin", - "map", - "maximize-2", - "maximize", - "menu", - "message-circle", - "message-square", - "mic-off", - "mic", - "minimize-2", - "minimize", - "minus-circle", - "minus-square", - "minus", - "monitor", - "moon", - "more-horizontal", - "more-vertical", - "move", - "music", - "navigation-2", - "navigation", - "octagon", - "package", - "paperclip", - "pause-circle", - "pause", - "percent", - "phone-call", - "phone-forwarded", - "phone-incoming", - "phone-missed", - "phone-off", - "phone-outgoing", - "phone", - "pie-chart", - "play-circle", - "play", - "plus-circle", - "plus-square", - "plus", - "pocket", - "power", - "printer", - "radio", - "refresh-ccw", - "refresh-cw", - "repeat", - "rewind", - "rotate-ccw", - "rotate-cw", - "rss", - "save", - "scissors", - "search", - "send", - "server", - "settings", - "share-2", - "share", - "shield-off", - "shield", - "shopping-bag", - "shopping-cart", - "shuffle", - "sidebar", - "skip-back", - "skip-forward", - "slash", - "sliders", - "smartphone", - "speaker", - "square", - "star", - "stop-circle", - "sun", - "sunrise", - "sunset", - "tablet", - "tag", - "target", - "terminal", - "thermometer", - "thumbs-down", - "thumbs-up", - "toggle-left", - "toggle-right", - "trash-2", - "trash", - "trending-down", - "trending-up", - "triangle", - "truck", - "tv", - "type", - "umbrella", - "underline", - "unlock", - "upload-cloud", - "upload", - "user-check", - "user-minus", - "user-plus", - "user-x", - "user", - "users", - "video-off", - "video", - "voicemail", - "volume-1", - "volume-2", - "volume-x", - "volume", - "watch", - "wifi-off", - "wifi", - "wind", - "x-circle", - "x-square", - "x", - "zap-off", - "zap", - "zoom-in", - "zoom-out" - ] - } - }, - "additionalProperties": false - } - }, - "required": ["name", "description", "runs"], - "then": { - "properties": { - "outputs": { - "$ref": "#/definitions/outputs-composite" - } - } - }, - "type": "object" -} +{ + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions", + "$id": "https://json.schemastore.org/github-action.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "definitions": { + "expressionSyntax": { + "type": "string", + "$comment": "escape `{` and `}` in pattern to be unicode compatible (#1360)", + "pattern": "^\\$\\{\\{(.|[\r\n])*\\}\\}$" + }, + "stringContainingExpressionSyntax": { + "type": "string", + "$comment": "escape `{` and `}` in pattern to be unicode compatible (#1360)", + "pattern": "^.*\\$\\{\\{(.|[\r\n])*\\}\\}.*$" + }, + "pre-if": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#pre-if", + "description": "Allows you to define conditions for the `pre:` action execution. The `pre:` action will only run if the conditions in `pre-if` are met. If not set, then `pre-if` defaults to `always()`. Note that the `step` context is unavailable, as no steps have run yet.", + "type": "string" + }, + "post-if": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#post-if", + "description": "Allows you to define conditions for the `post:` action execution. The `post:` action will only run if the conditions in `post-if` are met. If not set, then `post-if` defaults to `always()`.", + "type": "string" + }, + "runs-javascript": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-javascript-actions", + "description": "Configures the path to the action's code and the application used to execute the code.", + "type": "object", + "properties": { + "using": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsusing", + "description": "The application used to execute the code specified in `main`.", + "enum": ["node12", "node16", "node20"] + }, + "main": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsmain", + "description": "The file that contains your action code. The application specified in `using` executes this file.", + "type": "string" + }, + "pre": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#pre", + "description": "Allows you to run a script at the start of a job, before the `main:` action begins. For example, you can use `pre:` to run a prerequisite setup script. The application specified with the `using` syntax will execute this file. The `pre:` action always runs by default but you can override this using `pre-if`.", + "type": "string" + }, + "pre-if": { + "$ref": "#/definitions/pre-if" + }, + "post": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#post", + "description": "Allows you to run a script at the end of a job, once the `main:` action has completed. For example, you can use `post:` to terminate certain processes or remove unneeded files. The application specified with the `using` syntax will execute this file. The `post:` action always runs by default but you can override this using `post-if`.", + "type": "string" + }, + "post-if": { + "$ref": "#/definitions/post-if" + } + }, + "required": ["using", "main"], + "additionalProperties": false + }, + "runs-composite": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-composite-run-steps-actions", + "description": "Configures the path to the composite action, and the application used to execute the code.", + "type": "object", + "properties": { + "using": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsusing-1", + "description": "To use a composite run steps action, set this to 'composite'.", + "const": "composite" + }, + "steps": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runssteps", + "description": "The run steps that you plan to run in this action.", + "type": "array", + "items": { + "type": "object", + "properties": { + "run": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsrun", + "description": "The command you want to run. This can be inline or a script in your action repository.", + "type": "string" + }, + "shell": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsshell", + "description": "The shell where you want to run the command.", + "type": "string", + "anyOf": [ + { + "$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#custom-shell" + }, + { + "enum": [ + "bash", + "pwsh", + "python", + "sh", + "cmd", + "powershell" + ] + } + ] + }, + "uses": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsuses", + "description": "Selects an action to run as part of a step in your job.", + "type": "string" + }, + "with": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsstepswith", + "description": "A map of the input parameters defined by the action. Each input parameter is a key/value pair. Input parameters are set as environment variables. The variable is prefixed with INPUT_ and converted to upper case.", + "type": "object" + }, + "name": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsname", + "description": "The name of the composite run step.", + "type": "string" + }, + "id": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsid", + "description": "A unique identifier for the step. You can use the `id` to reference the step in contexts.", + "type": "string" + }, + "if": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsif", + "description": "You can use the if conditional to prevent a step from running unless a condition is met. You can use any supported context and expression to create a conditional.\nExpressions in an if conditional do not require the ${{ }} syntax. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.", + "type": "string" + }, + "env": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsenv", + "description": "Sets a map of environment variables for only that step.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "continue-on-error": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error", + "description": "Prevents a job from failing when a step fails. Set to true to allow a job to pass when this step fails.", + "oneOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/expressionSyntax" + } + ], + "default": false + }, + "working-directory": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsworking-directory", + "description": "Specifies the working directory where the command is run.", + "type": "string" + } + }, + "oneOf": [ + { + "required": ["run", "shell"] + }, + { + "required": ["uses"] + } + ], + "additionalProperties": false + } + } + }, + "required": ["using", "steps"], + "additionalProperties": false + }, + "runs-docker": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-docker-actions", + "description": "Configures the image used for the Docker action.", + "type": "object", + "properties": { + "using": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsusing-2", + "description": "You must set this value to 'docker'.", + "const": "docker" + }, + "image": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsimage", + "description": "The Docker image to use as the container to run the action. The value can be the Docker base image name, a local `Dockerfile` in your repository, or a public image in Docker Hub or another registry. To reference a `Dockerfile` local to your repository, use a path relative to your action metadata file. The `docker` application will execute this file.", + "type": "string" + }, + "env": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsenv", + "description": "Specifies a key/value map of environment variables to set in the container environment.", + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + { + "$ref": "#/definitions/stringContainingExpressionSyntax" + } + ] + }, + "entrypoint": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsentrypoint", + "description": "Overrides the Docker `ENTRYPOINT` in the `Dockerfile`, or sets it if one wasn't already specified. Use `entrypoint` when the `Dockerfile` does not specify an `ENTRYPOINT` or you want to override the `ENTRYPOINT` instruction. If you omit `entrypoint`, the commands you specify in the Docker `ENTRYPOINT` instruction will execute. The Docker `ENTRYPOINT instruction has a *shell* form and *exec* form. The Docker `ENTRYPOINT` documentation recommends using the *exec* form of the `ENTRYPOINT` instruction.", + "type": "string" + }, + "pre-entrypoint": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#pre-entrypoint", + "description": "Allows you to run a script before the `entrypoint` action begins. For example, you can use `pre-entrypoint:` to run a prerequisite setup script. GitHub Actions uses `docker run` to launch this action, and runs the script inside a new container that uses the same base image. This means that the runtime state is different from the main `entrypoint` container, and any states you require must be accessed in either the workspace, `HOME`, or as a `STATE_` variable. The `pre-entrypoint:` action always runs by default but you can override this using `pre-if`.", + "type": "string" + }, + "pre-if": { + "$ref": "#/definitions/pre-if" + }, + "post-entrypoint": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#post-entrypoint", + "description": "Allows you to run a cleanup script once the `runs.entrypoint` action has completed. GitHub Actions uses `docker run` to launch this action. Because GitHub Actions runs the script inside a new container using the same base image, the runtime state is different from the main `entrypoint` container. You can access any state you need in either the workspace, `HOME`, or as a `STATE_` variable. The `post-entrypoint:` action always runs by default but you can override this using `post-if`.", + "type": "string" + }, + "post-if": { + "$ref": "#/definitions/post-if" + }, + "args": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsargs", + "description": "An array of strings that define the inputs for a Docker container. Inputs can include hardcoded strings. GitHub passes the `args` to the container's `ENTRYPOINT` when the container starts up.\nThe `args` are used in place of the `CMD` instruction in a `Dockerfile`. If you use `CMD` in your `Dockerfile`, use the guidelines ordered by preference:\n- Document required arguments in the action's README and omit them from the `CMD` instruction.\n- Use defaults that allow using the action without specifying any `args`.\n- If the action exposes a `--help` flag, or something similar, use that to make your action self-documenting.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["using", "image"], + "additionalProperties": false + }, + "outputs": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#outputs", + "description": "Output parameters allow you to declare data that an action sets. Actions that run later in a workflow can use the output data set in previously run actions. For example, if you had an action that performed the addition of two inputs (x + y = z), the action could output the sum (z) for other actions to use as an input.\nIf you don't declare an output in your action metadata file, you can still set outputs and use them in a workflow.", + "type": "object", + "patternProperties": { + "^[_a-zA-Z][a-zA-Z0-9_-]*$": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#outputsoutput_id", + "description": "A string identifier to associate with the output. The value of `` is a map of the output's metadata. The `` must be a unique identifier within the outputs object. The `` must start with a letter or `_` and contain only alphanumeric characters, `-`, or `_`.", + "type": "object", + "properties": { + "description": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#outputsoutput_iddescription", + "description": "A string description of the output parameter.", + "type": "string" + } + }, + "required": ["description"], + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "outputs-composite": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#outputs-for-composite-run-steps-actions", + "description": "Output parameters allow you to declare data that an action sets. Actions that run later in a workflow can use the output data set in previously run actions. For example, if you had an action that performed the addition of two inputs (x + y = z), the action could output the sum (z) for other actions to use as an input.\nIf you don't declare an output in your action metadata file, you can still set outputs and use them in a workflow.", + "type": "object", + "patternProperties": { + "^[_a-zA-Z][a-zA-Z0-9_-]*$": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#outputsoutput_id", + "description": "A string identifier to associate with the output. The value of `` is a map of the output's metadata. The `` must be a unique identifier within the outputs object. The `` must start with a letter or `_` and contain only alphanumeric characters, `-`, or `_`.", + "type": "object", + "properties": { + "description": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#outputsoutput_iddescription", + "description": "A string description of the output parameter.", + "type": "string" + }, + "value": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#outputsoutput_idvalue", + "description": "The value that the output parameter will be mapped to. You can set this to a string or an expression with context. For example, you can use the steps context to set the value of an output to the output value of a step.", + "type": "string" + } + }, + "required": ["description", "value"], + "additionalProperties": false + } + }, + "additionalProperties": false + } + }, + "else": { + "properties": { + "outputs": { + "$ref": "#/definitions/outputs" + } + } + }, + "if": { + "properties": { + "runs": { + "properties": { + "using": { + "const": "composite" + } + } + } + } + }, + "properties": { + "name": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#name", + "description": "The name of your action. GitHub displays the `name` in the Actions tab to help visually identify actions in each job.", + "type": "string" + }, + "author": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#author", + "description": "The name of the action's author.", + "type": "string" + }, + "description": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#description", + "description": "A short description of the action.", + "type": "string" + }, + "inputs": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputs", + "description": "Input parameters allow you to specify data that the action expects to use during runtime. GitHub stores input parameters as environment variables. Input ids with uppercase letters are converted to lowercase during runtime. We recommended using lowercase input ids.", + "type": "object", + "patternProperties": { + "^[_a-zA-Z][a-zA-Z0-9_-]*$": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputsinput_id", + "description": "A string identifier to associate with the input. The value of `` is a map of the input's metadata. The `` must be a unique identifier within the inputs object. The `` must start with a letter or `_` and contain only alphanumeric characters, `-`, or `_`.", + "type": "object", + "properties": { + "description": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputsinput_iddescription", + "description": "A string description of the input parameter.", + "type": "string" + }, + "deprecationMessage": { + "description": "A string shown to users using the deprecated input.", + "type": "string" + }, + "required": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputsinput_idrequired", + "description": "A boolean to indicate whether the action requires the input parameter. Set to `true` when the parameter is required.", + "type": "boolean" + }, + "default": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputsinput_iddefault", + "description": "A string representing the default value. The default value is used when an input parameter isn't specified in a workflow file.", + "type": "string" + } + }, + "required": ["description"], + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "outputs": { + "$comment": "Because of `additionalProperties: false`, this empty schema is needed to allow the `outputs` property. The `outputs` subschema is determined by the if/then/else keywords." + }, + "runs": { + "oneOf": [ + { + "$ref": "#/definitions/runs-javascript" + }, + { + "$ref": "#/definitions/runs-composite" + }, + { + "$ref": "#/definitions/runs-docker" + } + ] + }, + "branding": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#branding", + "description": "You can use a color and Feather icon to create a badge to personalize and distinguish your action. Badges are shown next to your action name in GitHub Marketplace.", + "type": "object", + "properties": { + "color": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#brandingcolor", + "description": "The background color of the badge.", + "type": "string", + "enum": [ + "white", + "yellow", + "blue", + "green", + "orange", + "red", + "purple", + "gray-dark" + ] + }, + "icon": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#brandingicon", + "description": "The name of the Feather icon to use.", + "type": "string", + "enum": [ + "activity", + "airplay", + "alert-circle", + "alert-octagon", + "alert-triangle", + "align-center", + "align-justify", + "align-left", + "align-right", + "anchor", + "aperture", + "archive", + "arrow-down-circle", + "arrow-down-left", + "arrow-down-right", + "arrow-down", + "arrow-left-circle", + "arrow-left", + "arrow-right-circle", + "arrow-right", + "arrow-up-circle", + "arrow-up-left", + "arrow-up-right", + "arrow-up", + "at-sign", + "award", + "bar-chart-2", + "bar-chart", + "battery-charging", + "battery", + "bell-off", + "bell", + "bluetooth", + "bold", + "book-open", + "book", + "bookmark", + "box", + "briefcase", + "calendar", + "camera-off", + "camera", + "cast", + "check-circle", + "check-square", + "check", + "chevron-down", + "chevron-left", + "chevron-right", + "chevron-up", + "chevrons-down", + "chevrons-left", + "chevrons-right", + "chevrons-up", + "circle", + "clipboard", + "clock", + "cloud-drizzle", + "cloud-lightning", + "cloud-off", + "cloud-rain", + "cloud-snow", + "cloud", + "code", + "command", + "compass", + "copy", + "corner-down-left", + "corner-down-right", + "corner-left-down", + "corner-left-up", + "corner-right-down", + "corner-right-up", + "corner-up-left", + "corner-up-right", + "cpu", + "credit-card", + "crop", + "crosshair", + "database", + "delete", + "disc", + "dollar-sign", + "download-cloud", + "download", + "droplet", + "edit-2", + "edit-3", + "edit", + "external-link", + "eye-off", + "eye", + "facebook", + "fast-forward", + "feather", + "file-minus", + "file-plus", + "file-text", + "file", + "film", + "filter", + "flag", + "folder-minus", + "folder-plus", + "folder", + "gift", + "git-branch", + "git-commit", + "git-merge", + "git-pull-request", + "globe", + "grid", + "hard-drive", + "hash", + "headphones", + "heart", + "help-circle", + "home", + "image", + "inbox", + "info", + "italic", + "layers", + "layout", + "life-buoy", + "link-2", + "link", + "list", + "loader", + "lock", + "log-in", + "log-out", + "mail", + "map-pin", + "map", + "maximize-2", + "maximize", + "menu", + "message-circle", + "message-square", + "mic-off", + "mic", + "minimize-2", + "minimize", + "minus-circle", + "minus-square", + "minus", + "monitor", + "moon", + "more-horizontal", + "more-vertical", + "move", + "music", + "navigation-2", + "navigation", + "octagon", + "package", + "paperclip", + "pause-circle", + "pause", + "percent", + "phone-call", + "phone-forwarded", + "phone-incoming", + "phone-missed", + "phone-off", + "phone-outgoing", + "phone", + "pie-chart", + "play-circle", + "play", + "plus-circle", + "plus-square", + "plus", + "pocket", + "power", + "printer", + "radio", + "refresh-ccw", + "refresh-cw", + "repeat", + "rewind", + "rotate-ccw", + "rotate-cw", + "rss", + "save", + "scissors", + "search", + "send", + "server", + "settings", + "share-2", + "share", + "shield-off", + "shield", + "shopping-bag", + "shopping-cart", + "shuffle", + "sidebar", + "skip-back", + "skip-forward", + "slash", + "sliders", + "smartphone", + "speaker", + "square", + "star", + "stop-circle", + "sun", + "sunrise", + "sunset", + "tablet", + "tag", + "target", + "terminal", + "thermometer", + "thumbs-down", + "thumbs-up", + "toggle-left", + "toggle-right", + "trash-2", + "trash", + "trending-down", + "trending-up", + "triangle", + "truck", + "tv", + "type", + "umbrella", + "underline", + "unlock", + "upload-cloud", + "upload", + "user-check", + "user-minus", + "user-plus", + "user-x", + "user", + "users", + "video-off", + "video", + "voicemail", + "volume-1", + "volume-2", + "volume-x", + "volume", + "watch", + "wifi-off", + "wifi", + "wind", + "x-circle", + "x-square", + "x", + "zap-off", + "zap", + "zoom-in", + "zoom-out" + ] + } + }, + "additionalProperties": false + } + }, + "required": ["name", "description", "runs"], + "then": { + "properties": { + "outputs": { + "$ref": "#/definitions/outputs-composite" + } + } + }, + "type": "object" +} diff --git a/src/main/resources/schemas/github-discussion.json b/src/main/resources/schemas/github-discussion.json index 35276ac..02f8297 100644 --- a/src/main/resources/schemas/github-discussion.json +++ b/src/main/resources/schemas/github-discussion.json @@ -1,63 +1,63 @@ -{ - "$comment": "https://docs.github.com/en/discussions/managing-discussions-for-your-community/syntax-for-discussion-category-forms", - "$id": "https://json.schemastore.org/github-discussion.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "properties": { - "title": { - "description": "A default title that will be pre-populated in the discussion submission form.", - "type": "string" - }, - "labels": { - "description": "Labels that will automatically be added to discussions created with this template.", - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "body": { - "description": "Definition of the input types in the discussion form", - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["markdown", "textarea", "input", "dropdown", "checkboxes"] - }, - "attributes": { - "type": "object", - "properties": { - "label": { - "type": "string" - }, - "description": { - "type": "string" - }, - "placeholder": { - "type": "string" - } - } - }, - "validations": { - "type": "object", - "properties": { - "required": { - "type": "boolean" - } - } - } - } - } - } - }, - "required": ["body"], - "type": "object" -} +{ + "$comment": "https://docs.github.com/en/discussions/managing-discussions-for-your-community/syntax-for-discussion-category-forms", + "$id": "https://json.schemastore.org/github-discussion.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "title": { + "description": "A default title that will be pre-populated in the discussion submission form.", + "type": "string" + }, + "labels": { + "description": "Labels that will automatically be added to discussions created with this template.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "body": { + "description": "Definition of the input types in the discussion form", + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["markdown", "textarea", "input", "dropdown", "checkboxes"] + }, + "attributes": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "description": { + "type": "string" + }, + "placeholder": { + "type": "string" + } + } + }, + "validations": { + "type": "object", + "properties": { + "required": { + "type": "boolean" + } + } + } + } + } + } + }, + "required": ["body"], + "type": "object" +} diff --git a/src/main/resources/schemas/github-funding.json b/src/main/resources/schemas/github-funding.json index 709be71..cdb5954 100644 --- a/src/main/resources/schemas/github-funding.json +++ b/src/main/resources/schemas/github-funding.json @@ -1,107 +1,107 @@ -{ - "$comment": "https://docs.github.com/en/github/administering-a-repository/displaying-a-sponsor-button-in-your-repository", - "$id": "https://json.schemastore.org/github-funding.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { - "github_username": { - "type": "string", - "maxLength": 39, - "pattern": "^[a-zA-Z0-9](-?[a-zA-Z0-9])*$", - "examples": ["SampleUserName"] - }, - "nullable_string": { - "type": ["string", "null"] - } - }, - "description": "You can add a sponsor button in your repository to increase the visibility of funding options for your open source project.", - "properties": { - "community_bridge": { - "title": "CommunityBridge", - "description": "Project name on CommunityBridge.", - "$ref": "#/definitions/nullable_string", - "minLength": 1 - }, - "github": { - "title": "GitHub Sponsors", - "description": "Username or usernames on GitHub.", - "oneOf": [ - { - "$ref": "#/definitions/github_username" - }, - { - "type": "array", - "minItems": 1, - "uniqueItems": true, - "items": { - "$ref": "#/definitions/github_username" - } - } - ] - }, - "issuehunt": { - "title": "IssueHunt", - "description": "Username on IssueHunt.", - "$ref": "#/definitions/nullable_string", - "minLength": 1 - }, - "ko_fi": { - "title": "Ko-fi", - "description": "Username on Ko-fi.", - "$ref": "#/definitions/nullable_string", - "minLength": 1 - }, - "liberapay": { - "title": "Liberapay", - "description": "Username on Liberapay.", - "$ref": "#/definitions/nullable_string", - "minLength": 1 - }, - "open_collective": { - "title": "Open Collective", - "description": "Username on Open Collective.", - "$ref": "#/definitions/nullable_string", - "minLength": 1 - }, - "otechie": { - "title": "Otechie", - "description": "Username on Otechie.", - "$ref": "#/definitions/nullable_string", - "minLength": 1 - }, - "patreon": { - "title": "Patreon", - "description": "Username on Pateron.", - "$ref": "#/definitions/nullable_string", - "minLength": 1, - "maxLength": 100 - }, - "tidelift": { - "title": "Tidelift", - "description": "Platform and package on Tidelift.", - "$ref": "#/definitions/nullable_string", - "pattern": "^(npm|pypi|rubygems|maven|packagist|nuget)/.+$" - }, - "lfx_crowdfunding": { - "title": "LFX Crowdfunding", - "description": "Project name on LFX Crowdfunding.", - "$ref": "#/definitions/nullable_string", - "minLength": 1 - }, - "custom": { - "title": "Custom URL", - "description": "Link or links where funding is accepted on external locations.", - "type": ["string", "array", "null"], - "format": "uri-reference", - "items": { - "title": "Link", - "description": "Link to an external location.", - "type": "string", - "format": "uri-reference" - }, - "uniqueItems": true - } - }, - "title": "GitHub Funding", - "type": "object" -} +{ + "$comment": "https://docs.github.com/en/github/administering-a-repository/displaying-a-sponsor-button-in-your-repository", + "$id": "https://json.schemastore.org/github-funding.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "definitions": { + "github_username": { + "type": "string", + "maxLength": 39, + "pattern": "^[a-zA-Z0-9](-?[a-zA-Z0-9])*$", + "examples": ["SampleUserName"] + }, + "nullable_string": { + "type": ["string", "null"] + } + }, + "description": "You can add a sponsor button in your repository to increase the visibility of funding options for your open source project.", + "properties": { + "community_bridge": { + "title": "CommunityBridge", + "description": "Project name on CommunityBridge.", + "$ref": "#/definitions/nullable_string", + "minLength": 1 + }, + "github": { + "title": "GitHub Sponsors", + "description": "Username or usernames on GitHub.", + "oneOf": [ + { + "$ref": "#/definitions/github_username" + }, + { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/github_username" + } + } + ] + }, + "issuehunt": { + "title": "IssueHunt", + "description": "Username on IssueHunt.", + "$ref": "#/definitions/nullable_string", + "minLength": 1 + }, + "ko_fi": { + "title": "Ko-fi", + "description": "Username on Ko-fi.", + "$ref": "#/definitions/nullable_string", + "minLength": 1 + }, + "liberapay": { + "title": "Liberapay", + "description": "Username on Liberapay.", + "$ref": "#/definitions/nullable_string", + "minLength": 1 + }, + "open_collective": { + "title": "Open Collective", + "description": "Username on Open Collective.", + "$ref": "#/definitions/nullable_string", + "minLength": 1 + }, + "otechie": { + "title": "Otechie", + "description": "Username on Otechie.", + "$ref": "#/definitions/nullable_string", + "minLength": 1 + }, + "patreon": { + "title": "Patreon", + "description": "Username on Pateron.", + "$ref": "#/definitions/nullable_string", + "minLength": 1, + "maxLength": 100 + }, + "tidelift": { + "title": "Tidelift", + "description": "Platform and package on Tidelift.", + "$ref": "#/definitions/nullable_string", + "pattern": "^(npm|pypi|rubygems|maven|packagist|nuget)/.+$" + }, + "lfx_crowdfunding": { + "title": "LFX Crowdfunding", + "description": "Project name on LFX Crowdfunding.", + "$ref": "#/definitions/nullable_string", + "minLength": 1 + }, + "custom": { + "title": "Custom URL", + "description": "Link or links where funding is accepted on external locations.", + "type": ["string", "array", "null"], + "format": "uri-reference", + "items": { + "title": "Link", + "description": "Link to an external location.", + "type": "string", + "format": "uri-reference" + }, + "uniqueItems": true + } + }, + "title": "GitHub Funding", + "type": "object" +} diff --git a/src/main/resources/schemas/github-issue-config.json b/src/main/resources/schemas/github-issue-config.json index 0778d58..7e72360 100644 --- a/src/main/resources/schemas/github-issue-config.json +++ b/src/main/resources/schemas/github-issue-config.json @@ -1,45 +1,45 @@ -{ - "$comment": "https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser", - "$id": "https://json.schemastore.org/github-issue-config.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "blank_issues_enabled": { - "description": "Specify whether allow blank issue creation\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser", - "type": "boolean" - }, - "contact_links": { - "title": "contact links", - "description": "Contact links\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser", - "type": "array", - "minItems": 1, - "items": { - "type": "object", - "required": ["name", "url", "about"], - "properties": { - "name": { - "description": "A link title\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser", - "type": "string", - "minLength": 1, - "examples": ["Sample name"] - }, - "url": { - "description": "A link URL\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser", - "type": "string", - "pattern": "^https?://", - "examples": ["https://sample/url"] - }, - "about": { - "description": "A link description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser", - "type": "string", - "minLength": 1, - "examples": ["Sample description"] - } - }, - "additionalProperties": false - } - } - }, - "additionalProperties": false, - "title": "GitHub issue template chooser config file schema", - "type": "object" -} +{ + "$comment": "https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser", + "$id": "https://json.schemastore.org/github-issue-config.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "blank_issues_enabled": { + "description": "Specify whether allow blank issue creation\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser", + "type": "boolean" + }, + "contact_links": { + "title": "contact links", + "description": "Contact links\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser", + "type": "array", + "minItems": 1, + "items": { + "type": "object", + "required": ["name", "url", "about"], + "properties": { + "name": { + "description": "A link title\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser", + "type": "string", + "minLength": 1, + "examples": ["Sample name"] + }, + "url": { + "description": "A link URL\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser", + "type": "string", + "pattern": "^https?://", + "examples": ["https://sample/url"] + }, + "about": { + "description": "A link description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser", + "type": "string", + "minLength": 1, + "examples": ["Sample description"] + } + }, + "additionalProperties": false + } + } + }, + "additionalProperties": false, + "title": "GitHub issue template chooser config file schema", + "type": "object" +} diff --git a/src/main/resources/schemas/github-issue-forms.json b/src/main/resources/schemas/github-issue-forms.json index fb9d2a4..227a0ae 100644 --- a/src/main/resources/schemas/github-issue-forms.json +++ b/src/main/resources/schemas/github-issue-forms.json @@ -1,1290 +1,1290 @@ -{ - "$comment": "https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms", - "$id": "https://json.schemastore.org/github-issue-forms.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { - "type": { - "description": "A form item type\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#keys", - "type": "string", - "enum": ["checkboxes", "dropdown", "input", "markdown", "textarea"] - }, - "id": { - "type": "string", - "pattern": "^[a-zA-Z0-9_-]+$", - "examples": ["SampleId"] - }, - "validations": { - "title": "validation options", - "type": "object", - "properties": { - "required": { - "description": "Specify whether require a form item", - "type": "boolean", - "default": false - } - }, - "additionalProperties": false - }, - "assignee": { - "type": "string", - "maxLength": 39, - "pattern": "^[a-zA-Z0-9](-?[a-zA-Z0-9])*$", - "examples": ["SampleAssignee"] - }, - "label": { - "type": "string", - "minLength": 1, - "examples": ["Sample label"] - }, - "description": { - "type": "string", - "default": "", - "examples": ["Sample description"] - }, - "placeholder": { - "type": "string", - "default": "", - "examples": ["Sample placeholder"] - }, - "value": { - "type": "string", - "minLength": 1, - "examples": ["Sample value"] - }, - "form_item": { - "title": "form item", - "description": "A form item\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#about-githubs-form-schema", - "type": "object", - "required": ["type"], - "properties": { - "type": { - "$ref": "#/definitions/type" - } - }, - "allOf": [ - { - "if": { - "properties": { - "type": { - "const": "markdown" - } - } - }, - "then": { - "$comment": "For `additionalProperties` to work `type` must also be present here.", - "title": "markdown", - "description": "Markdown\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#markdown", - "type": "object", - "required": ["type", "attributes"], - "properties": { - "type": { - "$ref": "#/definitions/type" - }, - "attributes": { - "title": "markdown attributes", - "description": "Markdown attributes\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes", - "type": "object", - "required": ["value"], - "properties": { - "value": { - "description": "A markdown code\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes", - "type": "string", - "minLength": 1, - "examples": ["Sample code"] - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - }, - { - "if": { - "properties": { - "type": { - "const": "textarea" - } - } - }, - "then": { - "$comment": "For `additionalProperties` to work `type` must also be present here.", - "title": "textarea", - "description": "Textarea\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#textarea", - "type": "object", - "required": ["type", "attributes"], - "properties": { - "type": { - "$ref": "#/definitions/type" - }, - "id": { - "description": "A textarea id\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#keys", - "$ref": "#/definitions/id" - }, - "attributes": { - "title": "textarea attributes", - "description": "Textarea attributes\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-1", - "type": "object", - "required": ["label"], - "properties": { - "label": { - "description": "A short textarea description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-1", - "$ref": "#/definitions/label" - }, - "description": { - "description": "A long textarea description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-1", - "$ref": "#/definitions/description" - }, - "placeholder": { - "description": "A textarea placeholder\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-1", - "$ref": "#/definitions/placeholder" - }, - "value": { - "description": "A textarea value\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-1", - "$ref": "#/definitions/value" - }, - "render": { - "description": "A textarea syntax highlighting mode\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-1", - "type": "string", - "enum": [ - "1C Enterprise", - "4D", - "ABAP CDS", - "ABAP", - "ABNF", - "AFDKO", - "AGS Script", - "AIDL", - "AL", - "AMPL", - "ANTLR", - "API Blueprint", - "APL", - "ASL", - "ASN.1", - "ASP.NET", - "ATS", - "ActionScript", - "Ada", - "Alloy", - "Alpine Abuild", - "Altium Designer", - "AngelScript", - "Ant Build System", - "ApacheConf", - "Apex", - "Apollo Guidance Computer", - "AppleScript", - "Arc", - "AsciiDoc", - "AspectJ", - "Assembly", - "Astro", - "Asymptote", - "Augeas", - "AutoHotkey", - "AutoIt", - "AutoIt3", - "AutoItScript", - "Avro IDL", - "Awk", - "BASIC", - "Ballerina", - "Batchfile", - "Beef", - "Befunge", - "BibTeX", - "Bicep", - "Bison", - "BitBake", - "Blade", - "BlitzBasic", - "BlitzMax", - "Boo", - "Boogie", - "Brainfuck", - "Brightscript", - "Browserslist", - "C", - "C#", - "C++", - "C-ObjDump", - "C2hs Haskell", - "CIL", - "CLIPS", - "CMake", - "COBOL", - "CODEOWNERS", - "COLLADA", - "CSON", - "CSS", - "CSV", - "CUE", - "CWeb", - "Cabal Config", - "Cabal", - "Cap'n Proto", - "Carto", - "CartoCSS", - "Ceylon", - "Chapel", - "Charity", - "ChucK", - "Cirru", - "Clarion", - "Classic ASP", - "Clean", - "Click", - "Clojure", - "Closure Templates", - "Cloud Firestore Security Rules", - "CoNLL", - "CoNLL-U", - "CoNLL-X", - "ColdFusion CFC", - "ColdFusion", - "Common Lisp", - "Common Workflow Language", - "Component Pascal", - "Containerfile", - "Cool", - "Coq", - "Cpp-ObjDump", - "Crystal", - "Csound Document", - "Csound Score", - "Csound", - "Cuda", - "Cue Sheet", - "Cycript", - "Cython", - "D-ObjDump", - "DIGITAL Command Language", - "DM", - "DTrace", - "Dafny", - "Darcs Patch", - "Dart", - "DataWeave", - "Dhall", - "Diff", - "Dlang", - "Dockerfile", - "Dogescript", - "Dylan", - "E", - "E-mail", - "EBNF", - "ECL", - "ECLiPSe", - "EJS", - "EQ", - "Eagle", - "Earthly", - "Easybuild", - "Ecere Projects", - "EditorConfig", - "Eiffel", - "Elixir", - "Elm", - "Emacs Lisp", - "EmberScript", - "Erlang", - "F#", - "F*", - "FIGfont", - "FIGlet Font", - "FLUX", - "Factor", - "Fancy", - "Fantom", - "Faust", - "Fennel", - "Filebench WML", - "Filterscript", - "Fluent", - "Formatted", - "Forth", - "Fortran Free Form", - "Fortran", - "FreeBasic", - "Frege", - "Futhark", - "G-code", - "GAML", - "GAMS", - "GAP", - "GCC Machine Description", - "GDB", - "GDScript", - "GEDCOM", - "GLSL", - "GN", - "Game Maker Language", - "Gemfile.lock", - "Genie", - "Genshi", - "Gentoo Eclass", - "Gerber Image", - "Gettext Catalog", - "Gherkin", - "Git Config", - "Glyph Bitmap Distribution Format", - "Glyph", - "Gnuplot", - "Go Checksums", - "Go Module", - "Go", - "Golo", - "Gosu", - "Grace", - "Gradle", - "Grammatical Framework", - "Graph Modeling Language", - "GraphQL", - "Graphviz (DOT)", - "Groovy Server Pages", - "Groovy", - "HAProxy", - "HCL", - "HTML", - "HTML+ECR", - "HTML+EEX", - "HTML+ERB", - "HTML+PHP", - "HTML+Razor", - "HTTP", - "HXML", - "Hack", - "Haml", - "Handlebars", - "Harbour", - "HashiCorp Configuration Language", - "Haskell", - "Haxe", - "HiveQL", - "HolyC", - "Hy", - "IDL", - "IGOR Pro", - "IPython Notebook", - "Idris", - "Ignore List", - "ImageJ Macro", - "Inform 7", - "Io", - "Ioke", - "Isabelle ROOT", - "Isabelle", - "J", - "JAR Manifest", - "JFlex", - "JSON with Comments", - "JSON", - "JSON5", - "JSONLD", - "JSONiq", - "Jasmin", - "Java Properties", - "Java Server Pages", - "Java", - "JavaScript", - "JavaScript+ERB", - "Jest Snapshot", - "Jinja", - "Jison Lex", - "Jison", - "Jolie", - "Jsonnet", - "Julia", - "Jupyter Notebook", - "Kaitai Struct", - "KakouneScript", - "KiCad Layout", - "KiCad Legacy Layout", - "KiCad Schematic", - "Kit", - "Kotlin", - "Kusto", - "LFE", - "LLVM", - "LOLCODE", - "LSL", - "LTspice Symbol", - "LabVIEW", - "Lark", - "Lasso", - "Lean", - "Less", - "Lex", - "LilyPond", - "Limbo", - "Linker Script", - "Linux Kernel Module", - "Liquid", - "Literate Agda", - "Literate CoffeeScript", - "Literate Haskell", - "LiveScript", - "Logos", - "Logtalk", - "LookML", - "LoomScript", - "Lua", - "M", - "M4", - "M4Sugar", - "MATLAB", - "MAXScript", - "MLIR", - "MQL4", - "MQL5", - "MTML", - "MUF", - "Macaulay2", - "Makefile", - "Mako", - "Markdown", - "Marko", - "Mathematica", - "Max", - "Mercury", - "Meson", - "Metal", - "Microsoft Developer Studio Project", - "Microsoft Visual Studio Solution", - "MiniD", - "Mirah", - "Modelica", - "Modula-2", - "Modula-3", - "Module Management System", - "Monkey", - "Moocode", - "MoonScript", - "Motoko", - "Motorola 68K Assembly", - "Muse", - "Myghty", - "NASL", - "NCL", - "NEON", - "NPM Config", - "NSIS", - "NWScript", - "Nearley", - "Nemerle", - "NeoSnippet", - "NetLinx", - "NetLinx+ERB", - "NetLogo", - "NewLisp", - "Nextflow", - "Nginx", - "Ninja", - "Nit", - "Nix", - "NumPy", - "Nunjucks", - "ObjDump", - "Object Data Instance Notation", - "ObjectScript", - "Objective-C", - "Objective-C++", - "Objective-J", - "Odin", - "Omgrofl", - "Opa", - "Opal", - "Open Policy Agent", - "OpenCL", - "OpenEdge ABL", - "OpenQASM", - "OpenRC runscript", - "OpenSCAD", - "OpenStep Property List", - "OpenType Feature File", - "Org", - "Ox", - "Oxygene", - "Oz", - "P4", - "PEG.js", - "PHP", - "PLpgSQL", - "POV-Ray SDL", - "Pan", - "Papyrus", - "Parrot Assembly", - "Parrot Internal Representation", - "Parrot", - "Pascal", - "Pawn", - "Pep8", - "Perl", - "Pickle", - "PicoLisp", - "PigLatin", - "Pike", - "PlantUML", - "Pod 6", - "Pod", - "PogoScript", - "Pony", - "PostCSS", - "PostScript", - "PowerShell", - "Prisma", - "Processing", - "Proguard", - "Prolog", - "Promela", - "Propeller Spin", - "Protocol Buffer", - "Protocol Buffers", - "Public Key", - "Pug", - "Puppet", - "Pure Data", - "PureBasic", - "PureScript", - "Python", - "Q#", - "QMake", - "Qt Script", - "Quake", - "R", - "RAML", - "RDoc", - "REALbasic", - "REXX", - "RMarkdown", - "RPC", - "RPM Spec", - "Racket", - "Ragel", - "Raw token data", - "ReScript", - "Readline Config", - "Reason", - "Rebol", - "Record Jar", - "Red", - "Redirect Rules", - "Regular Expression", - "RenderScript", - "Rich Text Format", - "Ring", - "Riot", - "RobotFramework", - "Roff", - "Rouge", - "Rscript", - "Ruby", - "Rust", - "SAS", - "SCSS", - "SELinux Kernel Policy Language", - "SELinux Policy", - "SMT", - "SPARQL", - "SQF", - "SQL", - "SQLPL", - "SRecode Template", - "SSH Config", - "STON", - "SVG", - "SWIG", - "Sage", - "SaltStack", - "Sass", - "Scala", - "Scaml", - "Scheme", - "Scilab", - "Self", - "ShaderLab", - "Shell", - "ShellCheck Config", - "Sieve", - "Singularity", - "Slash", - "Slice", - "Slim", - "SmPL", - "Smalltalk", - "SnipMate", - "Solidity", - "Soong", - "SourcePawn", - "Spline Font Database", - "Squirrel", - "Stan", - "Standard ML", - "Starlark", - "StringTemplate", - "Stylus", - "SubRip Text", - "SugarSS", - "SuperCollider", - "Svelte", - "Swift", - "SystemVerilog", - "TI Program", - "TLA", - "TOML", - "TSQL", - "TSV", - "TSX", - "TXL", - "Tcl", - "Tcsh", - "TeX", - "Tea", - "Terra", - "Texinfo", - "Text", - "TextMate Properties", - "Textile", - "Thrift", - "Turing", - "Turtle", - "Twig", - "Type Language", - "TypeScript", - "UltiSnip", - "UltiSnips", - "Unified Parallel C", - "Unity3D Asset", - "Unix Assembly", - "Uno", - "UnrealScript", - "Ur", - "Ur/Web", - "UrWeb", - "V", - "VBA", - "VCL", - "VHDL", - "Vala", - "Valve Data Format", - "Verilog", - "Vim Help File", - "Vim Script", - "Vim Snippet", - "Visual Basic .NET", - "Vue", - "Wavefront Material", - "Wavefront Object", - "Web Ontology Language", - "WebAssembly", - "WebVTT", - "Wget Config", - "Wikitext", - "Windows Registry Entries", - "Wollok", - "World of Warcraft Addon Data", - "X BitMap", - "X Font Directory Index", - "X PixMap", - "X10", - "XC", - "XCompose", - "XML Property List", - "XML", - "XPages", - "XProc", - "XQuery", - "XS", - "XSLT", - "Xojo", - "Xonsh", - "Xtend", - "YAML", - "YANG", - "YARA", - "YASnippet", - "Yacc", - "ZAP", - "ZIL", - "Zeek", - "ZenScript", - "Zephir", - "Zig", - "Zimpl", - "abl", - "abuild", - "acfm", - "aconf", - "actionscript 3", - "actionscript3", - "ada2005", - "ada95", - "adobe composite font metrics", - "adobe multiple font metrics", - "advpl", - "ags", - "ahk", - "altium", - "amfm", - "amusewiki", - "apache", - "apkbuild", - "arexx", - "as3", - "asm", - "asp", - "aspx", - "aspx-vb", - "ats2", - "au3", - "autoconf", - "b3d", - "bash session", - "bash", - "bat", - "batch", - "bazel", - "blitz3d", - "blitzplus", - "bmax", - "bplus", - "bro", - "bsdmake", - "byond", - "bzl", - "c++-objdump", - "c2hs", - "cURL Config", - "cake", - "cakescript", - "cfc", - "cfm", - "cfml", - "chpl", - "clipper", - "coccinelle", - "coffee", - "coffee-script", - "coldfusion html", - "console", - "cperl", - "cpp", - "csharp", - "csound-csd", - "csound-orc", - "csound-sco", - "cucumber", - "curlrc", - "cwl", - "dcl", - "delphi", - "desktop", - "dircolors", - "django", - "dosbatch", - "dosini", - "dpatch", - "dtrace-script", - "eC", - "ecr", - "editor-config", - "edn", - "eeschema schematic", - "eex", - "elisp", - "emacs muse", - "emacs", - "email", - "eml", - "erb", - "fb", - "fish", - "flex", - "foxpro", - "fsharp", - "fstar", - "ftl", - "fundamental", - "gf", - "git-ignore", - "gitattributes", - "gitconfig", - "gitignore", - "gitmodules", - "go mod", - "go sum", - "go.mod", - "go.sum", - "golang", - "groff", - "gsp", - "hbs", - "heex", - "help", - "html+django", - "html+jinja", - "html+ruby", - "htmlbars", - "htmldjango", - "hylang", - "i7", - "ignore", - "igor", - "igorpro", - "ijm", - "inc", - "inform7", - "inputrc", - "irc logs", - "irc", - "java server page", - "jq", - "jruby", - "js", - "jsonc", - "jsp", - "kak", - "kakscript", - "keyvalues", - "ksy", - "lassoscript", - "latex", - "leex", - "lhaskell", - "lhs", - "lisp", - "litcoffee", - "live-script", - "ls", - "m2", - "m68k", - "mIRC Script", - "macruby", - "mail", - "make", - "man page", - "man", - "man-page", - "manpage", - "markojs", - "max/msp", - "maxmsp", - "mbox", - "mcfunction", - "mdoc", - "mediawiki", - "mf", - "mma", - "mumps", - "mupad", - "nanorc", - "nasm", - "ne-on", - "nesC", - "nette object notation", - "nginx configuration file", - "nixos", - "njk", - "node", - "npmrc", - "nroff", - "nush", - "nvim", - "obj-c", - "obj-c++", - "obj-j", - "objc", - "objc++", - "objectivec", - "objectivec++", - "objectivej", - "objectpascal", - "objj", - "octave", - "odin-lang", - "odinlang", - "oncrpc", - "ooc", - "openedge", - "openrc", - "osascript", - "pandoc", - "pasm", - "pcbnew", - "perl-6", - "perl6", - "pir", - "plain text", - "posh", - "postscr", - "pot", - "pov-ray", - "povray", - "progress", - "protobuf", - "pwsh", - "pycon", - "pyrex", - "python3", - "q", - "ql", - "qsharp", - "ragel-rb", - "ragel-ruby", - "rake", - "raw", - "razor", - "rb", - "rbx", - "reStructuredText", - "readline", - "red/system", - "redirects", - "regex", - "regexp", - "renpy", - "rhtml", - "robots txt", - "robots", - "robots.txt", - "rpcgen", - "rs", - "rs-274x", - "rss", - "rst", - "rusthon", - "salt", - "saltstate", - "sed", - "sepolicy", - "sh", - "shell-script", - "shellcheckrc", - "sml", - "snippet", - "sourcemod", - "soy", - "specfile", - "splus", - "squeak", - "terraform", - "tl", - "tm-properties", - "troff", - "ts", - "udiff", - "vb .net", - "vb.net", - "vb6", - "vbnet", - "vdf", - "vim", - "vimhelp", - "viml", - "visual basic 6", - "visual basic for applications", - "visual basic", - "vlang", - "wasm", - "wast", - "wdl", - "wgetrc", - "wiki", - "winbatch", - "wisp", - "wl", - "wolfram lang", - "wolfram language", - "wolfram", - "wsdl", - "xBase", - "xbm", - "xdr", - "xhtml", - "xml+genshi", - "xml+kid", - "xpm", - "xsd", - "xsl", - "xten", - "yas", - "yml", - "zsh" - ] - } - }, - "additionalProperties": false - }, - "validations": { - "title": "textarea validations", - "description": "Textarea validations\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#validations", - "$ref": "#/definitions/validations" - } - }, - "additionalProperties": false - } - }, - { - "if": { - "properties": { - "type": { - "const": "input" - } - } - }, - "then": { - "$comment": "For `additionalProperties` to work `type` must also be present here.", - "title": "input", - "description": "Input\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#input", - "type": "object", - "required": ["type", "attributes"], - "properties": { - "type": { - "$ref": "#/definitions/type" - }, - "id": { - "description": "An input id\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#keys", - "$ref": "#/definitions/id" - }, - "attributes": { - "title": "input attributes", - "description": "Input attributes\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-2", - "type": "object", - "required": ["label"], - "properties": { - "label": { - "description": "A short input description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-2", - "$ref": "#/definitions/label" - }, - "description": { - "description": "A long input description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-2", - "$ref": "#/definitions/description" - }, - "placeholder": { - "description": "An input placeholder\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-2", - "$ref": "#/definitions/placeholder" - }, - "value": { - "description": "An input value\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-2", - "$ref": "#/definitions/value" - } - }, - "additionalProperties": false - }, - "validations": { - "title": "input validations", - "description": "Input validations\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#validations-1", - "$ref": "#/definitions/validations" - } - }, - "additionalProperties": false - } - }, - { - "if": { - "properties": { - "type": { - "const": "dropdown" - } - } - }, - "then": { - "$comment": "For `additionalProperties` to work `type` must also be present here.", - "title": "dropdown", - "description": "dropdown\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#dropdown", - "type": "object", - "required": ["type", "attributes"], - "properties": { - "type": { - "$ref": "#/definitions/type" - }, - "id": { - "description": "A dropdown id\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#keys", - "$ref": "#/definitions/id" - }, - "attributes": { - "title": "dropdown attributes", - "description": "Dropdown attributes\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-3", - "type": "object", - "required": ["label", "options"], - "properties": { - "label": { - "description": "A short dropdown description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-3", - "$ref": "#/definitions/label" - }, - "description": { - "description": "A long dropdown description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-3", - "$ref": "#/definitions/description" - }, - "multiple": { - "description": "Specify whether allow a multiple choices\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-3", - "type": "boolean", - "default": false - }, - "options": { - "description": "Dropdown choices\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-3", - "type": "array", - "minItems": 1, - "uniqueItems": true, - "items": { - "type": "string", - "minLength": 1, - "examples": ["Sample choice"] - } - } - }, - "additionalProperties": false - }, - "validations": { - "title": "dropdown validations", - "description": "Dropdown validations\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#validations-2", - "$ref": "#/definitions/validations" - } - }, - "additionalProperties": false - } - }, - { - "if": { - "properties": { - "type": { - "const": "checkboxes" - } - } - }, - "then": { - "$comment": "For `additionalProperties` to work `type` must also be present here.", - "title": "checkboxes", - "description": "Checkboxes\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#checkboxes", - "type": "object", - "required": ["type", "attributes"], - "properties": { - "type": { - "$ref": "#/definitions/type" - }, - "id": { - "description": "Checkbox list id\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#keys", - "$ref": "#/definitions/id" - }, - "attributes": { - "title": "checkbox list attributes", - "description": "Checkbox list attributes\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-4", - "type": "object", - "required": ["label", "options"], - "properties": { - "label": { - "description": "A short checkbox list description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-4", - "$ref": "#/definitions/label" - }, - "description": { - "description": "A long checkbox list description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-4", - "$ref": "#/definitions/description" - }, - "options": { - "description": "Checkbox list choices\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-4", - "type": "array", - "minItems": 1, - "items": { - "title": "checkbox list choice", - "description": "Checkbox list choice\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-4", - "type": "object", - "required": ["label"], - "properties": { - "label": { - "description": "A short checkbox list choice description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-4", - "type": "string", - "minLength": 1, - "examples": ["Sample label"] - }, - "required": { - "description": "Specify whether a choise is required\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-4", - "type": "boolean", - "default": false - } - }, - "additionalProperties": false - } - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - } - ] - } - }, - "properties": { - "name": { - "description": "An issue template name\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms#top-level-syntax", - "type": "string", - "minLength": 1, - "examples": ["Sample name"] - }, - "description": { - "description": "An issue template description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms#top-level-syntax", - "type": "string", - "minLength": 1, - "examples": ["Sample description"] - }, - "body": { - "description": "An issue template body\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms#top-level-syntax", - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/form_item" - } - }, - "assignees": { - "description": "An issue template assignees\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms#top-level-syntax", - "oneOf": [ - { - "$ref": "#/definitions/assignee" - }, - { - "type": "array", - "minItems": 1, - "uniqueItems": true, - "items": { - "$ref": "#/definitions/assignee" - } - } - ] - }, - "labels": { - "description": "An issue template labels\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms#top-level-syntax", - "type": "array", - "minItems": 1, - "uniqueItems": true, - "items": { - "type": "string", - "minLength": 1, - "examples": [ - "Sample label", - "bug", - "documentation", - "duplicate", - "enhancement", - "good first issue", - "help wanted", - "invalid", - "question", - "wontfix" - ] - } - }, - "title": { - "description": "An issue template title\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms#top-level-syntax", - "type": "string", - "minLength": 1, - "examples": ["Sample title", "Bug: ", "Feature: "] - } - }, - "required": ["name", "description", "body"], - "title": "GitHub issue forms config file schema", - "type": "object" -} +{ + "$comment": "https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms", + "$id": "https://json.schemastore.org/github-issue-forms.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "definitions": { + "type": { + "description": "A form item type\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#keys", + "type": "string", + "enum": ["checkboxes", "dropdown", "input", "markdown", "textarea"] + }, + "id": { + "type": "string", + "pattern": "^[a-zA-Z0-9_-]+$", + "examples": ["SampleId"] + }, + "validations": { + "title": "validation options", + "type": "object", + "properties": { + "required": { + "description": "Specify whether require a form item", + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + }, + "assignee": { + "type": "string", + "maxLength": 39, + "pattern": "^[a-zA-Z0-9](-?[a-zA-Z0-9])*$", + "examples": ["SampleAssignee"] + }, + "label": { + "type": "string", + "minLength": 1, + "examples": ["Sample label"] + }, + "description": { + "type": "string", + "default": "", + "examples": ["Sample description"] + }, + "placeholder": { + "type": "string", + "default": "", + "examples": ["Sample placeholder"] + }, + "value": { + "type": "string", + "minLength": 1, + "examples": ["Sample value"] + }, + "form_item": { + "title": "form item", + "description": "A form item\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#about-githubs-form-schema", + "type": "object", + "required": ["type"], + "properties": { + "type": { + "$ref": "#/definitions/type" + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "markdown" + } + } + }, + "then": { + "$comment": "For `additionalProperties` to work `type` must also be present here.", + "title": "markdown", + "description": "Markdown\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#markdown", + "type": "object", + "required": ["type", "attributes"], + "properties": { + "type": { + "$ref": "#/definitions/type" + }, + "attributes": { + "title": "markdown attributes", + "description": "Markdown attributes\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes", + "type": "object", + "required": ["value"], + "properties": { + "value": { + "description": "A markdown code\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes", + "type": "string", + "minLength": 1, + "examples": ["Sample code"] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + }, + { + "if": { + "properties": { + "type": { + "const": "textarea" + } + } + }, + "then": { + "$comment": "For `additionalProperties` to work `type` must also be present here.", + "title": "textarea", + "description": "Textarea\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#textarea", + "type": "object", + "required": ["type", "attributes"], + "properties": { + "type": { + "$ref": "#/definitions/type" + }, + "id": { + "description": "A textarea id\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#keys", + "$ref": "#/definitions/id" + }, + "attributes": { + "title": "textarea attributes", + "description": "Textarea attributes\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-1", + "type": "object", + "required": ["label"], + "properties": { + "label": { + "description": "A short textarea description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-1", + "$ref": "#/definitions/label" + }, + "description": { + "description": "A long textarea description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-1", + "$ref": "#/definitions/description" + }, + "placeholder": { + "description": "A textarea placeholder\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-1", + "$ref": "#/definitions/placeholder" + }, + "value": { + "description": "A textarea value\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-1", + "$ref": "#/definitions/value" + }, + "render": { + "description": "A textarea syntax highlighting mode\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-1", + "type": "string", + "enum": [ + "1C Enterprise", + "4D", + "ABAP CDS", + "ABAP", + "ABNF", + "AFDKO", + "AGS Script", + "AIDL", + "AL", + "AMPL", + "ANTLR", + "API Blueprint", + "APL", + "ASL", + "ASN.1", + "ASP.NET", + "ATS", + "ActionScript", + "Ada", + "Alloy", + "Alpine Abuild", + "Altium Designer", + "AngelScript", + "Ant Build System", + "ApacheConf", + "Apex", + "Apollo Guidance Computer", + "AppleScript", + "Arc", + "AsciiDoc", + "AspectJ", + "Assembly", + "Astro", + "Asymptote", + "Augeas", + "AutoHotkey", + "AutoIt", + "AutoIt3", + "AutoItScript", + "Avro IDL", + "Awk", + "BASIC", + "Ballerina", + "Batchfile", + "Beef", + "Befunge", + "BibTeX", + "Bicep", + "Bison", + "BitBake", + "Blade", + "BlitzBasic", + "BlitzMax", + "Boo", + "Boogie", + "Brainfuck", + "Brightscript", + "Browserslist", + "C", + "C#", + "C++", + "C-ObjDump", + "C2hs Haskell", + "CIL", + "CLIPS", + "CMake", + "COBOL", + "CODEOWNERS", + "COLLADA", + "CSON", + "CSS", + "CSV", + "CUE", + "CWeb", + "Cabal Config", + "Cabal", + "Cap'n Proto", + "Carto", + "CartoCSS", + "Ceylon", + "Chapel", + "Charity", + "ChucK", + "Cirru", + "Clarion", + "Classic ASP", + "Clean", + "Click", + "Clojure", + "Closure Templates", + "Cloud Firestore Security Rules", + "CoNLL", + "CoNLL-U", + "CoNLL-X", + "ColdFusion CFC", + "ColdFusion", + "Common Lisp", + "Common Workflow Language", + "Component Pascal", + "Containerfile", + "Cool", + "Coq", + "Cpp-ObjDump", + "Crystal", + "Csound Document", + "Csound Score", + "Csound", + "Cuda", + "Cue Sheet", + "Cycript", + "Cython", + "D-ObjDump", + "DIGITAL Command Language", + "DM", + "DTrace", + "Dafny", + "Darcs Patch", + "Dart", + "DataWeave", + "Dhall", + "Diff", + "Dlang", + "Dockerfile", + "Dogescript", + "Dylan", + "E", + "E-mail", + "EBNF", + "ECL", + "ECLiPSe", + "EJS", + "EQ", + "Eagle", + "Earthly", + "Easybuild", + "Ecere Projects", + "EditorConfig", + "Eiffel", + "Elixir", + "Elm", + "Emacs Lisp", + "EmberScript", + "Erlang", + "F#", + "F*", + "FIGfont", + "FIGlet Font", + "FLUX", + "Factor", + "Fancy", + "Fantom", + "Faust", + "Fennel", + "Filebench WML", + "Filterscript", + "Fluent", + "Formatted", + "Forth", + "Fortran Free Form", + "Fortran", + "FreeBasic", + "Frege", + "Futhark", + "G-code", + "GAML", + "GAMS", + "GAP", + "GCC Machine Description", + "GDB", + "GDScript", + "GEDCOM", + "GLSL", + "GN", + "Game Maker Language", + "Gemfile.lock", + "Genie", + "Genshi", + "Gentoo Eclass", + "Gerber Image", + "Gettext Catalog", + "Gherkin", + "Git Config", + "Glyph Bitmap Distribution Format", + "Glyph", + "Gnuplot", + "Go Checksums", + "Go Module", + "Go", + "Golo", + "Gosu", + "Grace", + "Gradle", + "Grammatical Framework", + "Graph Modeling Language", + "GraphQL", + "Graphviz (DOT)", + "Groovy Server Pages", + "Groovy", + "HAProxy", + "HCL", + "HTML", + "HTML+ECR", + "HTML+EEX", + "HTML+ERB", + "HTML+PHP", + "HTML+Razor", + "HTTP", + "HXML", + "Hack", + "Haml", + "Handlebars", + "Harbour", + "HashiCorp Configuration Language", + "Haskell", + "Haxe", + "HiveQL", + "HolyC", + "Hy", + "IDL", + "IGOR Pro", + "IPython Notebook", + "Idris", + "Ignore List", + "ImageJ Macro", + "Inform 7", + "Io", + "Ioke", + "Isabelle ROOT", + "Isabelle", + "J", + "JAR Manifest", + "JFlex", + "JSON with Comments", + "JSON", + "JSON5", + "JSONLD", + "JSONiq", + "Jasmin", + "Java Properties", + "Java Server Pages", + "Java", + "JavaScript", + "JavaScript+ERB", + "Jest Snapshot", + "Jinja", + "Jison Lex", + "Jison", + "Jolie", + "Jsonnet", + "Julia", + "Jupyter Notebook", + "Kaitai Struct", + "KakouneScript", + "KiCad Layout", + "KiCad Legacy Layout", + "KiCad Schematic", + "Kit", + "Kotlin", + "Kusto", + "LFE", + "LLVM", + "LOLCODE", + "LSL", + "LTspice Symbol", + "LabVIEW", + "Lark", + "Lasso", + "Lean", + "Less", + "Lex", + "LilyPond", + "Limbo", + "Linker Script", + "Linux Kernel Module", + "Liquid", + "Literate Agda", + "Literate CoffeeScript", + "Literate Haskell", + "LiveScript", + "Logos", + "Logtalk", + "LookML", + "LoomScript", + "Lua", + "M", + "M4", + "M4Sugar", + "MATLAB", + "MAXScript", + "MLIR", + "MQL4", + "MQL5", + "MTML", + "MUF", + "Macaulay2", + "Makefile", + "Mako", + "Markdown", + "Marko", + "Mathematica", + "Max", + "Mercury", + "Meson", + "Metal", + "Microsoft Developer Studio Project", + "Microsoft Visual Studio Solution", + "MiniD", + "Mirah", + "Modelica", + "Modula-2", + "Modula-3", + "Module Management System", + "Monkey", + "Moocode", + "MoonScript", + "Motoko", + "Motorola 68K Assembly", + "Muse", + "Myghty", + "NASL", + "NCL", + "NEON", + "NPM Config", + "NSIS", + "NWScript", + "Nearley", + "Nemerle", + "NeoSnippet", + "NetLinx", + "NetLinx+ERB", + "NetLogo", + "NewLisp", + "Nextflow", + "Nginx", + "Ninja", + "Nit", + "Nix", + "NumPy", + "Nunjucks", + "ObjDump", + "Object Data Instance Notation", + "ObjectScript", + "Objective-C", + "Objective-C++", + "Objective-J", + "Odin", + "Omgrofl", + "Opa", + "Opal", + "Open Policy Agent", + "OpenCL", + "OpenEdge ABL", + "OpenQASM", + "OpenRC runscript", + "OpenSCAD", + "OpenStep Property List", + "OpenType Feature File", + "Org", + "Ox", + "Oxygene", + "Oz", + "P4", + "PEG.js", + "PHP", + "PLpgSQL", + "POV-Ray SDL", + "Pan", + "Papyrus", + "Parrot Assembly", + "Parrot Internal Representation", + "Parrot", + "Pascal", + "Pawn", + "Pep8", + "Perl", + "Pickle", + "PicoLisp", + "PigLatin", + "Pike", + "PlantUML", + "Pod 6", + "Pod", + "PogoScript", + "Pony", + "PostCSS", + "PostScript", + "PowerShell", + "Prisma", + "Processing", + "Proguard", + "Prolog", + "Promela", + "Propeller Spin", + "Protocol Buffer", + "Protocol Buffers", + "Public Key", + "Pug", + "Puppet", + "Pure Data", + "PureBasic", + "PureScript", + "Python", + "Q#", + "QMake", + "Qt Script", + "Quake", + "R", + "RAML", + "RDoc", + "REALbasic", + "REXX", + "RMarkdown", + "RPC", + "RPM Spec", + "Racket", + "Ragel", + "Raw token data", + "ReScript", + "Readline Config", + "Reason", + "Rebol", + "Record Jar", + "Red", + "Redirect Rules", + "Regular Expression", + "RenderScript", + "Rich Text Format", + "Ring", + "Riot", + "RobotFramework", + "Roff", + "Rouge", + "Rscript", + "Ruby", + "Rust", + "SAS", + "SCSS", + "SELinux Kernel Policy Language", + "SELinux Policy", + "SMT", + "SPARQL", + "SQF", + "SQL", + "SQLPL", + "SRecode Template", + "SSH Config", + "STON", + "SVG", + "SWIG", + "Sage", + "SaltStack", + "Sass", + "Scala", + "Scaml", + "Scheme", + "Scilab", + "Self", + "ShaderLab", + "Shell", + "ShellCheck Config", + "Sieve", + "Singularity", + "Slash", + "Slice", + "Slim", + "SmPL", + "Smalltalk", + "SnipMate", + "Solidity", + "Soong", + "SourcePawn", + "Spline Font Database", + "Squirrel", + "Stan", + "Standard ML", + "Starlark", + "StringTemplate", + "Stylus", + "SubRip Text", + "SugarSS", + "SuperCollider", + "Svelte", + "Swift", + "SystemVerilog", + "TI Program", + "TLA", + "TOML", + "TSQL", + "TSV", + "TSX", + "TXL", + "Tcl", + "Tcsh", + "TeX", + "Tea", + "Terra", + "Texinfo", + "Text", + "TextMate Properties", + "Textile", + "Thrift", + "Turing", + "Turtle", + "Twig", + "Type Language", + "TypeScript", + "UltiSnip", + "UltiSnips", + "Unified Parallel C", + "Unity3D Asset", + "Unix Assembly", + "Uno", + "UnrealScript", + "Ur", + "Ur/Web", + "UrWeb", + "V", + "VBA", + "VCL", + "VHDL", + "Vala", + "Valve Data Format", + "Verilog", + "Vim Help File", + "Vim Script", + "Vim Snippet", + "Visual Basic .NET", + "Vue", + "Wavefront Material", + "Wavefront Object", + "Web Ontology Language", + "WebAssembly", + "WebVTT", + "Wget Config", + "Wikitext", + "Windows Registry Entries", + "Wollok", + "World of Warcraft Addon Data", + "X BitMap", + "X Font Directory Index", + "X PixMap", + "X10", + "XC", + "XCompose", + "XML Property List", + "XML", + "XPages", + "XProc", + "XQuery", + "XS", + "XSLT", + "Xojo", + "Xonsh", + "Xtend", + "YAML", + "YANG", + "YARA", + "YASnippet", + "Yacc", + "ZAP", + "ZIL", + "Zeek", + "ZenScript", + "Zephir", + "Zig", + "Zimpl", + "abl", + "abuild", + "acfm", + "aconf", + "actionscript 3", + "actionscript3", + "ada2005", + "ada95", + "adobe composite font metrics", + "adobe multiple font metrics", + "advpl", + "ags", + "ahk", + "altium", + "amfm", + "amusewiki", + "apache", + "apkbuild", + "arexx", + "as3", + "asm", + "asp", + "aspx", + "aspx-vb", + "ats2", + "au3", + "autoconf", + "b3d", + "bash session", + "bash", + "bat", + "batch", + "bazel", + "blitz3d", + "blitzplus", + "bmax", + "bplus", + "bro", + "bsdmake", + "byond", + "bzl", + "c++-objdump", + "c2hs", + "cURL Config", + "cake", + "cakescript", + "cfc", + "cfm", + "cfml", + "chpl", + "clipper", + "coccinelle", + "coffee", + "coffee-script", + "coldfusion html", + "console", + "cperl", + "cpp", + "csharp", + "csound-csd", + "csound-orc", + "csound-sco", + "cucumber", + "curlrc", + "cwl", + "dcl", + "delphi", + "desktop", + "dircolors", + "django", + "dosbatch", + "dosini", + "dpatch", + "dtrace-script", + "eC", + "ecr", + "editor-config", + "edn", + "eeschema schematic", + "eex", + "elisp", + "emacs muse", + "emacs", + "email", + "eml", + "erb", + "fb", + "fish", + "flex", + "foxpro", + "fsharp", + "fstar", + "ftl", + "fundamental", + "gf", + "git-ignore", + "gitattributes", + "gitconfig", + "gitignore", + "gitmodules", + "go mod", + "go sum", + "go.mod", + "go.sum", + "golang", + "groff", + "gsp", + "hbs", + "heex", + "help", + "html+django", + "html+jinja", + "html+ruby", + "htmlbars", + "htmldjango", + "hylang", + "i7", + "ignore", + "igor", + "igorpro", + "ijm", + "inc", + "inform7", + "inputrc", + "irc logs", + "irc", + "java server page", + "jq", + "jruby", + "js", + "jsonc", + "jsp", + "kak", + "kakscript", + "keyvalues", + "ksy", + "lassoscript", + "latex", + "leex", + "lhaskell", + "lhs", + "lisp", + "litcoffee", + "live-script", + "ls", + "m2", + "m68k", + "mIRC Script", + "macruby", + "mail", + "make", + "man page", + "man", + "man-page", + "manpage", + "markojs", + "max/msp", + "maxmsp", + "mbox", + "mcfunction", + "mdoc", + "mediawiki", + "mf", + "mma", + "mumps", + "mupad", + "nanorc", + "nasm", + "ne-on", + "nesC", + "nette object notation", + "nginx configuration file", + "nixos", + "njk", + "node", + "npmrc", + "nroff", + "nush", + "nvim", + "obj-c", + "obj-c++", + "obj-j", + "objc", + "objc++", + "objectivec", + "objectivec++", + "objectivej", + "objectpascal", + "objj", + "octave", + "odin-lang", + "odinlang", + "oncrpc", + "ooc", + "openedge", + "openrc", + "osascript", + "pandoc", + "pasm", + "pcbnew", + "perl-6", + "perl6", + "pir", + "plain text", + "posh", + "postscr", + "pot", + "pov-ray", + "povray", + "progress", + "protobuf", + "pwsh", + "pycon", + "pyrex", + "python3", + "q", + "ql", + "qsharp", + "ragel-rb", + "ragel-ruby", + "rake", + "raw", + "razor", + "rb", + "rbx", + "reStructuredText", + "readline", + "red/system", + "redirects", + "regex", + "regexp", + "renpy", + "rhtml", + "robots txt", + "robots", + "robots.txt", + "rpcgen", + "rs", + "rs-274x", + "rss", + "rst", + "rusthon", + "salt", + "saltstate", + "sed", + "sepolicy", + "sh", + "shell-script", + "shellcheckrc", + "sml", + "snippet", + "sourcemod", + "soy", + "specfile", + "splus", + "squeak", + "terraform", + "tl", + "tm-properties", + "troff", + "ts", + "udiff", + "vb .net", + "vb.net", + "vb6", + "vbnet", + "vdf", + "vim", + "vimhelp", + "viml", + "visual basic 6", + "visual basic for applications", + "visual basic", + "vlang", + "wasm", + "wast", + "wdl", + "wgetrc", + "wiki", + "winbatch", + "wisp", + "wl", + "wolfram lang", + "wolfram language", + "wolfram", + "wsdl", + "xBase", + "xbm", + "xdr", + "xhtml", + "xml+genshi", + "xml+kid", + "xpm", + "xsd", + "xsl", + "xten", + "yas", + "yml", + "zsh" + ] + } + }, + "additionalProperties": false + }, + "validations": { + "title": "textarea validations", + "description": "Textarea validations\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#validations", + "$ref": "#/definitions/validations" + } + }, + "additionalProperties": false + } + }, + { + "if": { + "properties": { + "type": { + "const": "input" + } + } + }, + "then": { + "$comment": "For `additionalProperties` to work `type` must also be present here.", + "title": "input", + "description": "Input\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#input", + "type": "object", + "required": ["type", "attributes"], + "properties": { + "type": { + "$ref": "#/definitions/type" + }, + "id": { + "description": "An input id\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#keys", + "$ref": "#/definitions/id" + }, + "attributes": { + "title": "input attributes", + "description": "Input attributes\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-2", + "type": "object", + "required": ["label"], + "properties": { + "label": { + "description": "A short input description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-2", + "$ref": "#/definitions/label" + }, + "description": { + "description": "A long input description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-2", + "$ref": "#/definitions/description" + }, + "placeholder": { + "description": "An input placeholder\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-2", + "$ref": "#/definitions/placeholder" + }, + "value": { + "description": "An input value\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-2", + "$ref": "#/definitions/value" + } + }, + "additionalProperties": false + }, + "validations": { + "title": "input validations", + "description": "Input validations\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#validations-1", + "$ref": "#/definitions/validations" + } + }, + "additionalProperties": false + } + }, + { + "if": { + "properties": { + "type": { + "const": "dropdown" + } + } + }, + "then": { + "$comment": "For `additionalProperties` to work `type` must also be present here.", + "title": "dropdown", + "description": "dropdown\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#dropdown", + "type": "object", + "required": ["type", "attributes"], + "properties": { + "type": { + "$ref": "#/definitions/type" + }, + "id": { + "description": "A dropdown id\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#keys", + "$ref": "#/definitions/id" + }, + "attributes": { + "title": "dropdown attributes", + "description": "Dropdown attributes\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-3", + "type": "object", + "required": ["label", "options"], + "properties": { + "label": { + "description": "A short dropdown description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-3", + "$ref": "#/definitions/label" + }, + "description": { + "description": "A long dropdown description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-3", + "$ref": "#/definitions/description" + }, + "multiple": { + "description": "Specify whether allow a multiple choices\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-3", + "type": "boolean", + "default": false + }, + "options": { + "description": "Dropdown choices\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-3", + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "minLength": 1, + "examples": ["Sample choice"] + } + } + }, + "additionalProperties": false + }, + "validations": { + "title": "dropdown validations", + "description": "Dropdown validations\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#validations-2", + "$ref": "#/definitions/validations" + } + }, + "additionalProperties": false + } + }, + { + "if": { + "properties": { + "type": { + "const": "checkboxes" + } + } + }, + "then": { + "$comment": "For `additionalProperties` to work `type` must also be present here.", + "title": "checkboxes", + "description": "Checkboxes\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#checkboxes", + "type": "object", + "required": ["type", "attributes"], + "properties": { + "type": { + "$ref": "#/definitions/type" + }, + "id": { + "description": "Checkbox list id\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#keys", + "$ref": "#/definitions/id" + }, + "attributes": { + "title": "checkbox list attributes", + "description": "Checkbox list attributes\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-4", + "type": "object", + "required": ["label", "options"], + "properties": { + "label": { + "description": "A short checkbox list description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-4", + "$ref": "#/definitions/label" + }, + "description": { + "description": "A long checkbox list description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-4", + "$ref": "#/definitions/description" + }, + "options": { + "description": "Checkbox list choices\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-4", + "type": "array", + "minItems": 1, + "items": { + "title": "checkbox list choice", + "description": "Checkbox list choice\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-4", + "type": "object", + "required": ["label"], + "properties": { + "label": { + "description": "A short checkbox list choice description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-4", + "type": "string", + "minLength": 1, + "examples": ["Sample label"] + }, + "required": { + "description": "Specify whether a choice is required\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-4", + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + } + ] + } + }, + "properties": { + "name": { + "description": "An issue template name\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms#top-level-syntax", + "type": "string", + "minLength": 1, + "examples": ["Sample name"] + }, + "description": { + "description": "An issue template description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms#top-level-syntax", + "type": "string", + "minLength": 1, + "examples": ["Sample description"] + }, + "body": { + "description": "An issue template body\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms#top-level-syntax", + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/form_item" + } + }, + "assignees": { + "description": "An issue template assignees\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms#top-level-syntax", + "oneOf": [ + { + "$ref": "#/definitions/assignee" + }, + { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/assignee" + } + } + ] + }, + "labels": { + "description": "An issue template labels\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms#top-level-syntax", + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "minLength": 1, + "examples": [ + "Sample label", + "bug", + "documentation", + "duplicate", + "enhancement", + "good first issue", + "help wanted", + "invalid", + "question", + "wontfix" + ] + } + }, + "title": { + "description": "An issue template title\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms#top-level-syntax", + "type": "string", + "minLength": 1, + "examples": ["Sample title", "Bug: ", "Feature: "] + } + }, + "required": ["name", "description", "body"], + "title": "GitHub issue forms config file schema", + "type": "object" +} diff --git a/src/main/resources/schemas/github-workflow-template-properties.json b/src/main/resources/schemas/github-workflow-template-properties.json index 95f324a..e5dc2c9 100644 --- a/src/main/resources/schemas/github-workflow-template-properties.json +++ b/src/main/resources/schemas/github-workflow-template-properties.json @@ -1,916 +1,916 @@ -{ - "$comment": "https://docs.github.com/en/actions/using-workflows/creating-starter-workflows-for-your-organization", - "$id": "https://json.schemastore.org/github-workflow-template-properties.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "properties": { - "name": { - "description": "A workflow template name\nhttps://docs.github.com/en/actions/using-workflows/creating-starter-workflows-for-your-organization#creating-a-starter-workflow", - "type": "string", - "minLength": 1, - "examples": ["Sample name"] - }, - "description": { - "description": "A workflow template description\nhttps://docs.github.com/en/actions/using-workflows/creating-starter-workflows-for-your-organization#creating-a-starter-workflow", - "type": "string", - "minLength": 1, - "examples": ["Sample description"] - }, - "iconName": { - "description": "A workflow template icon\nMust be the name of an SVG file, without the file name extension, stored in the workflow-templates directory\nhttps://docs.github.com/en/actions/using-workflows/creating-starter-workflows-for-your-organization#creating-a-starter-workflow", - "type": "string", - "minLength": 1, - "examples": ["Sample icon"] - }, - "categories": { - "description": "A workflow category\nhttps://docs.github.com/en/actions/using-workflows/creating-starter-workflows-for-your-organization#creating-a-starter-workflow", - "type": "array", - "uniqueItems": true, - "minItems": 1, - "items": { - "type": "string", - "enum": [ - "1C Enterprise", - "4D", - "ABAP CDS", - "ABAP", - "ABNF", - "AFDKO", - "AGS Script", - "AIDL", - "AL", - "AMPL", - "ANTLR", - "API Blueprint", - "APL", - "ASL", - "ASN.1", - "ASP.NET", - "ATS", - "ActionScript", - "Ada", - "Alloy", - "Alpine Abuild", - "Altium Designer", - "AngelScript", - "Ant Build System", - "ApacheConf", - "Apex", - "Apollo Guidance Computer", - "AppleScript", - "Arc", - "AsciiDoc", - "AspectJ", - "Assembly", - "Astro", - "Asymptote", - "Augeas", - "AutoHotkey", - "AutoIt", - "AutoIt3", - "AutoItScript", - "Avro IDL", - "Awk", - "BASIC", - "Ballerina", - "Batchfile", - "Beef", - "Befunge", - "BibTeX", - "Bicep", - "Bison", - "BitBake", - "Blade", - "BlitzBasic", - "BlitzMax", - "Boo", - "Boogie", - "Brainfuck", - "Brightscript", - "Browserslist", - "C", - "C#", - "C++", - "C-ObjDump", - "C2hs Haskell", - "CIL", - "CLIPS", - "CMake", - "COBOL", - "CODEOWNERS", - "COLLADA", - "CSON", - "CSS", - "CSV", - "CUE", - "CWeb", - "Cabal Config", - "Cabal", - "Cap'n Proto", - "Carto", - "CartoCSS", - "Ceylon", - "Chapel", - "Charity", - "ChucK", - "Cirru", - "Clarion", - "Classic ASP", - "Clean", - "Click", - "Clojure", - "Closure Templates", - "Cloud Firestore Security Rules", - "CoNLL", - "CoNLL-U", - "CoNLL-X", - "ColdFusion CFC", - "ColdFusion", - "Common Lisp", - "Common Workflow Language", - "Component Pascal", - "Containerfile", - "Cool", - "Coq", - "Cpp-ObjDump", - "Crystal", - "Csound Document", - "Csound Score", - "Csound", - "Cuda", - "Cue Sheet", - "Cycript", - "Cython", - "D-ObjDump", - "DIGITAL Command Language", - "DM", - "DTrace", - "Dafny", - "Darcs Patch", - "Dart", - "DataWeave", - "Dhall", - "Diff", - "Dlang", - "Dockerfile", - "Dogescript", - "Dylan", - "E", - "E-mail", - "EBNF", - "ECL", - "ECLiPSe", - "EJS", - "EQ", - "Eagle", - "Earthly", - "Easybuild", - "Ecere Projects", - "EditorConfig", - "Eiffel", - "Elixir", - "Elm", - "Emacs Lisp", - "EmberScript", - "Erlang", - "F#", - "F*", - "FIGfont", - "FIGlet Font", - "FLUX", - "Factor", - "Fancy", - "Fantom", - "Faust", - "Fennel", - "Filebench WML", - "Filterscript", - "Fluent", - "Formatted", - "Forth", - "Fortran Free Form", - "Fortran", - "FreeBasic", - "Frege", - "Futhark", - "G-code", - "GAML", - "GAMS", - "GAP", - "GCC Machine Description", - "GDB", - "GDScript", - "GEDCOM", - "GLSL", - "GN", - "Game Maker Language", - "Gemfile.lock", - "Genie", - "Genshi", - "Gentoo Eclass", - "Gerber Image", - "Gettext Catalog", - "Gherkin", - "Git Config", - "Glyph Bitmap Distribution Format", - "Glyph", - "Gnuplot", - "Go Checksums", - "Go Module", - "Go", - "Golo", - "Gosu", - "Grace", - "Gradle", - "Grammatical Framework", - "Graph Modeling Language", - "GraphQL", - "Graphviz (DOT)", - "Groovy Server Pages", - "Groovy", - "HAProxy", - "HCL", - "HTML", - "HTML+ECR", - "HTML+EEX", - "HTML+ERB", - "HTML+PHP", - "HTML+Razor", - "HTTP", - "HXML", - "Hack", - "Haml", - "Handlebars", - "Harbour", - "HashiCorp Configuration Language", - "Haskell", - "Haxe", - "HiveQL", - "HolyC", - "Hy", - "IDL", - "IGOR Pro", - "IPython Notebook", - "Idris", - "Ignore List", - "ImageJ Macro", - "Inform 7", - "Io", - "Ioke", - "Isabelle ROOT", - "Isabelle", - "J", - "JAR Manifest", - "JFlex", - "JSON with Comments", - "JSON", - "JSON5", - "JSONLD", - "JSONiq", - "Jasmin", - "Java Properties", - "Java Server Pages", - "Java", - "JavaScript", - "JavaScript+ERB", - "Jest Snapshot", - "Jinja", - "Jison Lex", - "Jison", - "Jolie", - "Jsonnet", - "Julia", - "Jupyter Notebook", - "Kaitai Struct", - "KakouneScript", - "KiCad Layout", - "KiCad Legacy Layout", - "KiCad Schematic", - "Kit", - "Kotlin", - "Kusto", - "LFE", - "LLVM", - "LOLCODE", - "LSL", - "LTspice Symbol", - "LabVIEW", - "Lark", - "Lasso", - "Lean", - "Less", - "Lex", - "LilyPond", - "Limbo", - "Linker Script", - "Linux Kernel Module", - "Liquid", - "Literate Agda", - "Literate CoffeeScript", - "Literate Haskell", - "LiveScript", - "Logos", - "Logtalk", - "LookML", - "LoomScript", - "Lua", - "M", - "M4", - "M4Sugar", - "MATLAB", - "MAXScript", - "MLIR", - "MQL4", - "MQL5", - "MTML", - "MUF", - "Macaulay2", - "Makefile", - "Mako", - "Markdown", - "Marko", - "Mathematica", - "Max", - "Mercury", - "Meson", - "Metal", - "Microsoft Developer Studio Project", - "Microsoft Visual Studio Solution", - "MiniD", - "Mirah", - "Modelica", - "Modula-2", - "Modula-3", - "Module Management System", - "Monkey", - "Moocode", - "MoonScript", - "Motoko", - "Motorola 68K Assembly", - "Muse", - "Myghty", - "NASL", - "NCL", - "NEON", - "NPM Config", - "NSIS", - "NWScript", - "Nearley", - "Nemerle", - "NeoSnippet", - "NetLinx", - "NetLinx+ERB", - "NetLogo", - "NewLisp", - "Nextflow", - "Nginx", - "Ninja", - "Nit", - "Nix", - "NumPy", - "Nunjucks", - "ObjDump", - "Object Data Instance Notation", - "ObjectScript", - "Objective-C", - "Objective-C++", - "Objective-J", - "Odin", - "Omgrofl", - "Opa", - "Opal", - "Open Policy Agent", - "OpenCL", - "OpenEdge ABL", - "OpenQASM", - "OpenRC runscript", - "OpenSCAD", - "OpenStep Property List", - "OpenType Feature File", - "Org", - "Ox", - "Oxygene", - "Oz", - "P4", - "PEG.js", - "PHP", - "PLpgSQL", - "POV-Ray SDL", - "Pan", - "Papyrus", - "Parrot Assembly", - "Parrot Internal Representation", - "Parrot", - "Pascal", - "Pawn", - "Pep8", - "Perl", - "Pickle", - "PicoLisp", - "PigLatin", - "Pike", - "PlantUML", - "Pod 6", - "Pod", - "PogoScript", - "Pony", - "PostCSS", - "PostScript", - "PowerShell", - "Prisma", - "Processing", - "Proguard", - "Prolog", - "Promela", - "Propeller Spin", - "Protocol Buffer", - "Protocol Buffers", - "Public Key", - "Pug", - "Puppet", - "Pure Data", - "PureBasic", - "PureScript", - "Python", - "Q#", - "QMake", - "Qt Script", - "Quake", - "R", - "RAML", - "RDoc", - "REALbasic", - "REXX", - "RMarkdown", - "RPC", - "RPM Spec", - "Racket", - "Ragel", - "Raw token data", - "ReScript", - "Readline Config", - "Reason", - "Rebol", - "Record Jar", - "Red", - "Redirect Rules", - "Regular Expression", - "RenderScript", - "Rich Text Format", - "Ring", - "Riot", - "RobotFramework", - "Roff", - "Rouge", - "Rscript", - "Ruby", - "Rust", - "SAS", - "SCSS", - "SELinux Kernel Policy Language", - "SELinux Policy", - "SMT", - "SPARQL", - "SQF", - "SQL", - "SQLPL", - "SRecode Template", - "SSH Config", - "STON", - "SVG", - "SWIG", - "Sage", - "SaltStack", - "Sass", - "Scala", - "Scaml", - "Scheme", - "Scilab", - "Self", - "ShaderLab", - "Shell", - "ShellCheck Config", - "Sieve", - "Singularity", - "Slash", - "Slice", - "Slim", - "SmPL", - "Smalltalk", - "SnipMate", - "Solidity", - "Soong", - "SourcePawn", - "Spline Font Database", - "Squirrel", - "Stan", - "Standard ML", - "Starlark", - "StringTemplate", - "Stylus", - "SubRip Text", - "SugarSS", - "SuperCollider", - "Svelte", - "Swift", - "SystemVerilog", - "TI Program", - "TLA", - "TOML", - "TSQL", - "TSV", - "TSX", - "TXL", - "Tcl", - "Tcsh", - "TeX", - "Tea", - "Terra", - "Texinfo", - "Text", - "TextMate Properties", - "Textile", - "Thrift", - "Turing", - "Turtle", - "Twig", - "Type Language", - "TypeScript", - "UltiSnip", - "UltiSnips", - "Unified Parallel C", - "Unity3D Asset", - "Unix Assembly", - "Uno", - "UnrealScript", - "Ur", - "Ur/Web", - "UrWeb", - "V", - "VBA", - "VCL", - "VHDL", - "Vala", - "Valve Data Format", - "Verilog", - "Vim Help File", - "Vim Script", - "Vim Snippet", - "Visual Basic .NET", - "Vue", - "Wavefront Material", - "Wavefront Object", - "Web Ontology Language", - "WebAssembly", - "WebVTT", - "Wget Config", - "Wikitext", - "Windows Registry Entries", - "Wollok", - "World of Warcraft Addon Data", - "X BitMap", - "X Font Directory Index", - "X PixMap", - "X10", - "XC", - "XCompose", - "XML Property List", - "XML", - "XPages", - "XProc", - "XQuery", - "XS", - "XSLT", - "Xojo", - "Xonsh", - "Xtend", - "YAML", - "YANG", - "YARA", - "YASnippet", - "Yacc", - "ZAP", - "ZIL", - "Zeek", - "ZenScript", - "Zephir", - "Zig", - "Zimpl", - "abl", - "abuild", - "acfm", - "aconf", - "actionscript 3", - "actionscript3", - "ada2005", - "ada95", - "adobe composite font metrics", - "adobe multiple font metrics", - "advpl", - "ags", - "ahk", - "altium", - "amfm", - "amusewiki", - "apache", - "apkbuild", - "arexx", - "as3", - "asm", - "asp", - "aspx", - "aspx-vb", - "ats2", - "au3", - "autoconf", - "b3d", - "bash session", - "bash", - "bat", - "batch", - "bazel", - "blitz3d", - "blitzplus", - "bmax", - "bplus", - "bro", - "bsdmake", - "byond", - "bzl", - "c++-objdump", - "c2hs", - "cURL Config", - "cake", - "cakescript", - "cfc", - "cfm", - "cfml", - "chpl", - "clipper", - "coccinelle", - "coffee", - "coffee-script", - "coldfusion html", - "console", - "cperl", - "cpp", - "csharp", - "csound-csd", - "csound-orc", - "csound-sco", - "cucumber", - "curlrc", - "cwl", - "dcl", - "delphi", - "desktop", - "dircolors", - "django", - "dosbatch", - "dosini", - "dpatch", - "dtrace-script", - "eC", - "ecr", - "editor-config", - "edn", - "eeschema schematic", - "eex", - "elisp", - "emacs muse", - "emacs", - "email", - "eml", - "erb", - "fb", - "fish", - "flex", - "foxpro", - "fsharp", - "fstar", - "ftl", - "fundamental", - "gf", - "git-ignore", - "gitattributes", - "gitconfig", - "gitignore", - "gitmodules", - "go mod", - "go sum", - "go.mod", - "go.sum", - "golang", - "groff", - "gsp", - "hbs", - "heex", - "help", - "html+django", - "html+jinja", - "html+ruby", - "htmlbars", - "htmldjango", - "hylang", - "i7", - "ignore", - "igor", - "igorpro", - "ijm", - "inc", - "inform7", - "inputrc", - "irc logs", - "irc", - "java server page", - "jq", - "jruby", - "js", - "jsonc", - "jsp", - "kak", - "kakscript", - "keyvalues", - "ksy", - "lassoscript", - "latex", - "leex", - "lhaskell", - "lhs", - "lisp", - "litcoffee", - "live-script", - "ls", - "m2", - "m68k", - "mIRC Script", - "macruby", - "mail", - "make", - "man page", - "man", - "man-page", - "manpage", - "markojs", - "max/msp", - "maxmsp", - "mbox", - "mcfunction", - "mdoc", - "mediawiki", - "mf", - "mma", - "mumps", - "mupad", - "nanorc", - "nasm", - "ne-on", - "nesC", - "nette object notation", - "nginx configuration file", - "nixos", - "njk", - "node", - "npmrc", - "nroff", - "nush", - "nvim", - "obj-c", - "obj-c++", - "obj-j", - "objc", - "objc++", - "objectivec", - "objectivec++", - "objectivej", - "objectpascal", - "objj", - "octave", - "odin-lang", - "odinlang", - "oncrpc", - "ooc", - "openedge", - "openrc", - "osascript", - "pandoc", - "pasm", - "pcbnew", - "perl-6", - "perl6", - "pir", - "plain text", - "posh", - "postscr", - "pot", - "pov-ray", - "povray", - "progress", - "protobuf", - "pwsh", - "pycon", - "pyrex", - "python3", - "q", - "ql", - "qsharp", - "ragel-rb", - "ragel-ruby", - "rake", - "raw", - "razor", - "rb", - "rbx", - "reStructuredText", - "readline", - "red/system", - "redirects", - "regex", - "regexp", - "renpy", - "rhtml", - "robots txt", - "robots", - "robots.txt", - "rpcgen", - "rs", - "rs-274x", - "rss", - "rst", - "rusthon", - "salt", - "saltstate", - "sed", - "sepolicy", - "sh", - "shell-script", - "shellcheckrc", - "sml", - "snippet", - "sourcemod", - "soy", - "specfile", - "splus", - "squeak", - "terraform", - "tl", - "tm-properties", - "troff", - "ts", - "udiff", - "vb .net", - "vb.net", - "vb6", - "vbnet", - "vdf", - "vim", - "vimhelp", - "viml", - "visual basic 6", - "visual basic for applications", - "visual basic", - "vlang", - "wasm", - "wast", - "wdl", - "wgetrc", - "wiki", - "winbatch", - "wisp", - "wl", - "wolfram lang", - "wolfram language", - "wolfram", - "wsdl", - "xBase", - "xbm", - "xdr", - "xhtml", - "xml+genshi", - "xml+kid", - "xpm", - "xsd", - "xsl", - "xten", - "yas", - "yml", - "zsh" - ] - } - }, - "filePatterns": { - "description": "A file name pattern to match against repository to enable this workflow when match is succeed\nhttps://docs.github.com/en/actions/using-workflows/creating-starter-workflows-for-your-organization#creating-a-starter-workflow", - "type": "array", - "minItems": 1, - "uniqueItems": true, - "items": { - "type": "string", - "minLength": 1, - "examples": ["*.sample"] - } - } - }, - "required": ["name", "description"], - "title": "GitHub starter workflow config file schema", - "type": "object" -} +{ + "$comment": "https://docs.github.com/en/actions/using-workflows/creating-starter-workflows-for-your-organization", + "$id": "https://json.schemastore.org/github-workflow-template-properties.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "name": { + "description": "A workflow template name\nhttps://docs.github.com/en/actions/using-workflows/creating-starter-workflows-for-your-organization#creating-a-starter-workflow", + "type": "string", + "minLength": 1, + "examples": ["Sample name"] + }, + "description": { + "description": "A workflow template description\nhttps://docs.github.com/en/actions/using-workflows/creating-starter-workflows-for-your-organization#creating-a-starter-workflow", + "type": "string", + "minLength": 1, + "examples": ["Sample description"] + }, + "iconName": { + "description": "A workflow template icon\nMust be the name of an SVG file, without the file name extension, stored in the workflow-templates directory\nhttps://docs.github.com/en/actions/using-workflows/creating-starter-workflows-for-your-organization#creating-a-starter-workflow", + "type": "string", + "minLength": 1, + "examples": ["Sample icon"] + }, + "categories": { + "description": "A workflow category\nhttps://docs.github.com/en/actions/using-workflows/creating-starter-workflows-for-your-organization#creating-a-starter-workflow", + "type": "array", + "uniqueItems": true, + "minItems": 1, + "items": { + "type": "string", + "enum": [ + "1C Enterprise", + "4D", + "ABAP CDS", + "ABAP", + "ABNF", + "AFDKO", + "AGS Script", + "AIDL", + "AL", + "AMPL", + "ANTLR", + "API Blueprint", + "APL", + "ASL", + "ASN.1", + "ASP.NET", + "ATS", + "ActionScript", + "Ada", + "Alloy", + "Alpine Abuild", + "Altium Designer", + "AngelScript", + "Ant Build System", + "ApacheConf", + "Apex", + "Apollo Guidance Computer", + "AppleScript", + "Arc", + "AsciiDoc", + "AspectJ", + "Assembly", + "Astro", + "Asymptote", + "Augeas", + "AutoHotkey", + "AutoIt", + "AutoIt3", + "AutoItScript", + "Avro IDL", + "Awk", + "BASIC", + "Ballerina", + "Batchfile", + "Beef", + "Befunge", + "BibTeX", + "Bicep", + "Bison", + "BitBake", + "Blade", + "BlitzBasic", + "BlitzMax", + "Boo", + "Boogie", + "Brainfuck", + "Brightscript", + "Browserslist", + "C", + "C#", + "C++", + "C-ObjDump", + "C2hs Haskell", + "CIL", + "CLIPS", + "CMake", + "COBOL", + "CODEOWNERS", + "COLLADA", + "CSON", + "CSS", + "CSV", + "CUE", + "CWeb", + "Cabal Config", + "Cabal", + "Cap'n Proto", + "Carto", + "CartoCSS", + "Ceylon", + "Chapel", + "Charity", + "ChucK", + "Cirru", + "Clarion", + "Classic ASP", + "Clean", + "Click", + "Clojure", + "Closure Templates", + "Cloud Firestore Security Rules", + "CoNLL", + "CoNLL-U", + "CoNLL-X", + "ColdFusion CFC", + "ColdFusion", + "Common Lisp", + "Common Workflow Language", + "Component Pascal", + "Containerfile", + "Cool", + "Coq", + "Cpp-ObjDump", + "Crystal", + "Csound Document", + "Csound Score", + "Csound", + "Cuda", + "Cue Sheet", + "Cycript", + "Cython", + "D-ObjDump", + "DIGITAL Command Language", + "DM", + "DTrace", + "Dafny", + "Darcs Patch", + "Dart", + "DataWeave", + "Dhall", + "Diff", + "Dlang", + "Dockerfile", + "Dogescript", + "Dylan", + "E", + "E-mail", + "EBNF", + "ECL", + "ECLiPSe", + "EJS", + "EQ", + "Eagle", + "Earthly", + "Easybuild", + "Ecere Projects", + "EditorConfig", + "Eiffel", + "Elixir", + "Elm", + "Emacs Lisp", + "EmberScript", + "Erlang", + "F#", + "F*", + "FIGfont", + "FIGlet Font", + "FLUX", + "Factor", + "Fancy", + "Fantom", + "Faust", + "Fennel", + "Filebench WML", + "Filterscript", + "Fluent", + "Formatted", + "Forth", + "Fortran Free Form", + "Fortran", + "FreeBasic", + "Frege", + "Futhark", + "G-code", + "GAML", + "GAMS", + "GAP", + "GCC Machine Description", + "GDB", + "GDScript", + "GEDCOM", + "GLSL", + "GN", + "Game Maker Language", + "Gemfile.lock", + "Genie", + "Genshi", + "Gentoo Eclass", + "Gerber Image", + "Gettext Catalog", + "Gherkin", + "Git Config", + "Glyph Bitmap Distribution Format", + "Glyph", + "Gnuplot", + "Go Checksums", + "Go Module", + "Go", + "Golo", + "Gosu", + "Grace", + "Gradle", + "Grammatical Framework", + "Graph Modeling Language", + "GraphQL", + "Graphviz (DOT)", + "Groovy Server Pages", + "Groovy", + "HAProxy", + "HCL", + "HTML", + "HTML+ECR", + "HTML+EEX", + "HTML+ERB", + "HTML+PHP", + "HTML+Razor", + "HTTP", + "HXML", + "Hack", + "Haml", + "Handlebars", + "Harbour", + "HashiCorp Configuration Language", + "Haskell", + "Haxe", + "HiveQL", + "HolyC", + "Hy", + "IDL", + "IGOR Pro", + "IPython Notebook", + "Idris", + "Ignore List", + "ImageJ Macro", + "Inform 7", + "Io", + "Ioke", + "Isabelle ROOT", + "Isabelle", + "J", + "JAR Manifest", + "JFlex", + "JSON with Comments", + "JSON", + "JSON5", + "JSONLD", + "JSONiq", + "Jasmin", + "Java Properties", + "Java Server Pages", + "Java", + "JavaScript", + "JavaScript+ERB", + "Jest Snapshot", + "Jinja", + "Jison Lex", + "Jison", + "Jolie", + "Jsonnet", + "Julia", + "Jupyter Notebook", + "Kaitai Struct", + "KakouneScript", + "KiCad Layout", + "KiCad Legacy Layout", + "KiCad Schematic", + "Kit", + "Kotlin", + "Kusto", + "LFE", + "LLVM", + "LOLCODE", + "LSL", + "LTspice Symbol", + "LabVIEW", + "Lark", + "Lasso", + "Lean", + "Less", + "Lex", + "LilyPond", + "Limbo", + "Linker Script", + "Linux Kernel Module", + "Liquid", + "Literate Agda", + "Literate CoffeeScript", + "Literate Haskell", + "LiveScript", + "Logos", + "Logtalk", + "LookML", + "LoomScript", + "Lua", + "M", + "M4", + "M4Sugar", + "MATLAB", + "MAXScript", + "MLIR", + "MQL4", + "MQL5", + "MTML", + "MUF", + "Macaulay2", + "Makefile", + "Mako", + "Markdown", + "Marko", + "Mathematica", + "Max", + "Mercury", + "Meson", + "Metal", + "Microsoft Developer Studio Project", + "Microsoft Visual Studio Solution", + "MiniD", + "Mirah", + "Modelica", + "Modula-2", + "Modula-3", + "Module Management System", + "Monkey", + "Moocode", + "MoonScript", + "Motoko", + "Motorola 68K Assembly", + "Muse", + "Myghty", + "NASL", + "NCL", + "NEON", + "NPM Config", + "NSIS", + "NWScript", + "Nearley", + "Nemerle", + "NeoSnippet", + "NetLinx", + "NetLinx+ERB", + "NetLogo", + "NewLisp", + "Nextflow", + "Nginx", + "Ninja", + "Nit", + "Nix", + "NumPy", + "Nunjucks", + "ObjDump", + "Object Data Instance Notation", + "ObjectScript", + "Objective-C", + "Objective-C++", + "Objective-J", + "Odin", + "Omgrofl", + "Opa", + "Opal", + "Open Policy Agent", + "OpenCL", + "OpenEdge ABL", + "OpenQASM", + "OpenRC runscript", + "OpenSCAD", + "OpenStep Property List", + "OpenType Feature File", + "Org", + "Ox", + "Oxygene", + "Oz", + "P4", + "PEG.js", + "PHP", + "PLpgSQL", + "POV-Ray SDL", + "Pan", + "Papyrus", + "Parrot Assembly", + "Parrot Internal Representation", + "Parrot", + "Pascal", + "Pawn", + "Pep8", + "Perl", + "Pickle", + "PicoLisp", + "PigLatin", + "Pike", + "PlantUML", + "Pod 6", + "Pod", + "PogoScript", + "Pony", + "PostCSS", + "PostScript", + "PowerShell", + "Prisma", + "Processing", + "Proguard", + "Prolog", + "Promela", + "Propeller Spin", + "Protocol Buffer", + "Protocol Buffers", + "Public Key", + "Pug", + "Puppet", + "Pure Data", + "PureBasic", + "PureScript", + "Python", + "Q#", + "QMake", + "Qt Script", + "Quake", + "R", + "RAML", + "RDoc", + "REALbasic", + "REXX", + "RMarkdown", + "RPC", + "RPM Spec", + "Racket", + "Ragel", + "Raw token data", + "ReScript", + "Readline Config", + "Reason", + "Rebol", + "Record Jar", + "Red", + "Redirect Rules", + "Regular Expression", + "RenderScript", + "Rich Text Format", + "Ring", + "Riot", + "RobotFramework", + "Roff", + "Rouge", + "Rscript", + "Ruby", + "Rust", + "SAS", + "SCSS", + "SELinux Kernel Policy Language", + "SELinux Policy", + "SMT", + "SPARQL", + "SQF", + "SQL", + "SQLPL", + "SRecode Template", + "SSH Config", + "STON", + "SVG", + "SWIG", + "Sage", + "SaltStack", + "Sass", + "Scala", + "Scaml", + "Scheme", + "Scilab", + "Self", + "ShaderLab", + "Shell", + "ShellCheck Config", + "Sieve", + "Singularity", + "Slash", + "Slice", + "Slim", + "SmPL", + "Smalltalk", + "SnipMate", + "Solidity", + "Soong", + "SourcePawn", + "Spline Font Database", + "Squirrel", + "Stan", + "Standard ML", + "Starlark", + "StringTemplate", + "Stylus", + "SubRip Text", + "SugarSS", + "SuperCollider", + "Svelte", + "Swift", + "SystemVerilog", + "TI Program", + "TLA", + "TOML", + "TSQL", + "TSV", + "TSX", + "TXL", + "Tcl", + "Tcsh", + "TeX", + "Tea", + "Terra", + "Texinfo", + "Text", + "TextMate Properties", + "Textile", + "Thrift", + "Turing", + "Turtle", + "Twig", + "Type Language", + "TypeScript", + "UltiSnip", + "UltiSnips", + "Unified Parallel C", + "Unity3D Asset", + "Unix Assembly", + "Uno", + "UnrealScript", + "Ur", + "Ur/Web", + "UrWeb", + "V", + "VBA", + "VCL", + "VHDL", + "Vala", + "Valve Data Format", + "Verilog", + "Vim Help File", + "Vim Script", + "Vim Snippet", + "Visual Basic .NET", + "Vue", + "Wavefront Material", + "Wavefront Object", + "Web Ontology Language", + "WebAssembly", + "WebVTT", + "Wget Config", + "Wikitext", + "Windows Registry Entries", + "Wollok", + "World of Warcraft Addon Data", + "X BitMap", + "X Font Directory Index", + "X PixMap", + "X10", + "XC", + "XCompose", + "XML Property List", + "XML", + "XPages", + "XProc", + "XQuery", + "XS", + "XSLT", + "Xojo", + "Xonsh", + "Xtend", + "YAML", + "YANG", + "YARA", + "YASnippet", + "Yacc", + "ZAP", + "ZIL", + "Zeek", + "ZenScript", + "Zephir", + "Zig", + "Zimpl", + "abl", + "abuild", + "acfm", + "aconf", + "actionscript 3", + "actionscript3", + "ada2005", + "ada95", + "adobe composite font metrics", + "adobe multiple font metrics", + "advpl", + "ags", + "ahk", + "altium", + "amfm", + "amusewiki", + "apache", + "apkbuild", + "arexx", + "as3", + "asm", + "asp", + "aspx", + "aspx-vb", + "ats2", + "au3", + "autoconf", + "b3d", + "bash session", + "bash", + "bat", + "batch", + "bazel", + "blitz3d", + "blitzplus", + "bmax", + "bplus", + "bro", + "bsdmake", + "byond", + "bzl", + "c++-objdump", + "c2hs", + "cURL Config", + "cake", + "cakescript", + "cfc", + "cfm", + "cfml", + "chpl", + "clipper", + "coccinelle", + "coffee", + "coffee-script", + "coldfusion html", + "console", + "cperl", + "cpp", + "csharp", + "csound-csd", + "csound-orc", + "csound-sco", + "cucumber", + "curlrc", + "cwl", + "dcl", + "delphi", + "desktop", + "dircolors", + "django", + "dosbatch", + "dosini", + "dpatch", + "dtrace-script", + "eC", + "ecr", + "editor-config", + "edn", + "eeschema schematic", + "eex", + "elisp", + "emacs muse", + "emacs", + "email", + "eml", + "erb", + "fb", + "fish", + "flex", + "foxpro", + "fsharp", + "fstar", + "ftl", + "fundamental", + "gf", + "git-ignore", + "gitattributes", + "gitconfig", + "gitignore", + "gitmodules", + "go mod", + "go sum", + "go.mod", + "go.sum", + "golang", + "groff", + "gsp", + "hbs", + "heex", + "help", + "html+django", + "html+jinja", + "html+ruby", + "htmlbars", + "htmldjango", + "hylang", + "i7", + "ignore", + "igor", + "igorpro", + "ijm", + "inc", + "inform7", + "inputrc", + "irc logs", + "irc", + "java server page", + "jq", + "jruby", + "js", + "jsonc", + "jsp", + "kak", + "kakscript", + "keyvalues", + "ksy", + "lassoscript", + "latex", + "leex", + "lhaskell", + "lhs", + "lisp", + "litcoffee", + "live-script", + "ls", + "m2", + "m68k", + "mIRC Script", + "macruby", + "mail", + "make", + "man page", + "man", + "man-page", + "manpage", + "markojs", + "max/msp", + "maxmsp", + "mbox", + "mcfunction", + "mdoc", + "mediawiki", + "mf", + "mma", + "mumps", + "mupad", + "nanorc", + "nasm", + "ne-on", + "nesC", + "nette object notation", + "nginx configuration file", + "nixos", + "njk", + "node", + "npmrc", + "nroff", + "nush", + "nvim", + "obj-c", + "obj-c++", + "obj-j", + "objc", + "objc++", + "objectivec", + "objectivec++", + "objectivej", + "objectpascal", + "objj", + "octave", + "odin-lang", + "odinlang", + "oncrpc", + "ooc", + "openedge", + "openrc", + "osascript", + "pandoc", + "pasm", + "pcbnew", + "perl-6", + "perl6", + "pir", + "plain text", + "posh", + "postscr", + "pot", + "pov-ray", + "povray", + "progress", + "protobuf", + "pwsh", + "pycon", + "pyrex", + "python3", + "q", + "ql", + "qsharp", + "ragel-rb", + "ragel-ruby", + "rake", + "raw", + "razor", + "rb", + "rbx", + "reStructuredText", + "readline", + "red/system", + "redirects", + "regex", + "regexp", + "renpy", + "rhtml", + "robots txt", + "robots", + "robots.txt", + "rpcgen", + "rs", + "rs-274x", + "rss", + "rst", + "rusthon", + "salt", + "saltstate", + "sed", + "sepolicy", + "sh", + "shell-script", + "shellcheckrc", + "sml", + "snippet", + "sourcemod", + "soy", + "specfile", + "splus", + "squeak", + "terraform", + "tl", + "tm-properties", + "troff", + "ts", + "udiff", + "vb .net", + "vb.net", + "vb6", + "vbnet", + "vdf", + "vim", + "vimhelp", + "viml", + "visual basic 6", + "visual basic for applications", + "visual basic", + "vlang", + "wasm", + "wast", + "wdl", + "wgetrc", + "wiki", + "winbatch", + "wisp", + "wl", + "wolfram lang", + "wolfram language", + "wolfram", + "wsdl", + "xBase", + "xbm", + "xdr", + "xhtml", + "xml+genshi", + "xml+kid", + "xpm", + "xsd", + "xsl", + "xten", + "yas", + "yml", + "zsh" + ] + } + }, + "filePatterns": { + "description": "A file name pattern to match against repository to enable this workflow when match is succeed\nhttps://docs.github.com/en/actions/using-workflows/creating-starter-workflows-for-your-organization#creating-a-starter-workflow", + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "minLength": 1, + "examples": ["*.sample"] + } + } + }, + "required": ["name", "description"], + "title": "GitHub starter workflow config file schema", + "type": "object" +} diff --git a/src/main/resources/schemas/github-workflow.json b/src/main/resources/schemas/github-workflow.json index e86acf3..0d6f24b 100644 --- a/src/main/resources/schemas/github-workflow.json +++ b/src/main/resources/schemas/github-workflow.json @@ -1,1733 +1,1733 @@ -{ - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions", - "$id": "https://json.schemastore.org/github-workflow.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { - "architecture": { - "type": "string", - "enum": ["ARM32", "x64", "x86"] - }, - "branch": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#onpushpull_requestbranchestags", - "$ref": "#/definitions/globs", - "description": "When using the push and pull_request events, you can configure a workflow to run on specific branches or tags. If you only define only tags or only branches, the workflow won't run for events affecting the undefined Git ref.\nThe branches, branches-ignore, tags, and tags-ignore keywords accept glob patterns that use the * and ** wildcard characters to match more than one branch or tag name. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet.\nThe patterns defined in branches and tags are evaluated against the Git ref's name. For example, defining the pattern mona/octocat in branches will match the refs/heads/mona/octocat Git ref. The pattern releases/** will match the refs/heads/releases/10 Git ref.\nYou can use two types of filters to prevent a workflow from running on pushes and pull requests to tags and branches:\n- branches or branches-ignore - You cannot use both the branches and branches-ignore filters for the same event in a workflow. Use the branches filter when you need to filter branches for positive matches and exclude branches. Use the branches-ignore filter when you only need to exclude branch names.\n- tags or tags-ignore - You cannot use both the tags and tags-ignore filters for the same event in a workflow. Use the tags filter when you need to filter tags for positive matches and exclude tags. Use the tags-ignore filter when you only need to exclude tag names.\nYou can exclude tags and branches using the ! character. The order that you define patterns matters.\n- A matching negative pattern (prefixed with !) after a positive match will exclude the Git ref.\n- A matching positive pattern after a negative match will include the Git ref again." - }, - "concurrency": { - "type": "object", - "properties": { - "group": { - "$comment": "https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-using-concurrency-to-cancel-any-in-progress-job-or-run-1", - "description": "When a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the repository is in progress, the queued job or workflow will be pending. Any previously pending job or workflow in the concurrency group will be canceled.", - "type": "string" - }, - "cancel-in-progress": { - "$comment": "https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-using-concurrency-to-cancel-any-in-progress-job-or-run-1", - "description": "To cancel any currently running job or workflow in the same concurrency group, specify cancel-in-progress: true.", - "oneOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/expressionSyntax" - } - ] - } - }, - "required": ["group"], - "additionalProperties": false - }, - "configuration": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "boolean" - }, - { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/configuration" - } - }, - { - "type": "array", - "items": { - "$ref": "#/definitions/configuration" - } - } - ] - }, - "container": { - "type": "object", - "properties": { - "image": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idcontainerimage", - "description": "The Docker image to use as the container to run the action. The value can be the Docker Hub image name or a registry name.", - "type": "string" - }, - "credentials": { - "$comment": "https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idcontainercredentials", - "description": "If the image's container registry requires authentication to pull the image, you can use credentials to set a map of the username and password. The credentials are the same values that you would provide to the `docker login` command.", - "type": "object", - "properties": { - "username": { - "type": "string" - }, - "password": { - "type": "string" - } - } - }, - "env": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idcontainerenv", - "$ref": "#/definitions/env", - "description": "Sets an array of environment variables in the container." - }, - "ports": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idcontainerports", - "description": "Sets an array of ports to expose on the container.", - "type": "array", - "items": { - "oneOf": [ - { - "type": "number" - }, - { - "type": "string" - } - ] - }, - "minItems": 1 - }, - "volumes": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idcontainervolumes", - "description": "Sets an array of volumes for the container to use. You can use volumes to share data between services or other steps in a job. You can specify named Docker volumes, anonymous Docker volumes, or bind mounts on the host.\nTo specify a volume, you specify the source and destination path: :\nThe is a volume name or an absolute path on the host machine, and is an absolute path in the container.", - "type": "array", - "items": { - "type": "string", - "pattern": "^[^:]+:[^:]+$" - }, - "minItems": 1 - }, - "options": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idcontaineroptions", - "description": "Additional Docker container resource options. For a list of options, see https://docs.docker.com/engine/reference/commandline/create/#options.", - "type": "string" - } - }, - "required": ["image"], - "additionalProperties": false - }, - "defaults": { - "type": "object", - "properties": { - "run": { - "type": "object", - "properties": { - "shell": { - "$ref": "#/definitions/shell" - }, - "working-directory": { - "$ref": "#/definitions/working-directory" - } - }, - "minProperties": 1, - "additionalProperties": false - } - }, - "minProperties": 1, - "additionalProperties": false - }, - "permissions": { - "$comment": "https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#permissions", - "description": "You can modify the default permissions granted to the GITHUB_TOKEN, adding or removing access as required, so that you only allow the minimum required access.", - "oneOf": [ - { - "type": "string", - "enum": ["read-all", "write-all"] - }, - { - "$ref": "#/definitions/permissions-event" - } - ] - }, - "permissions-event": { - "type": "object", - "additionalProperties": false, - "properties": { - "actions": { - "$ref": "#/definitions/permissions-level" - }, - "checks": { - "$ref": "#/definitions/permissions-level" - }, - "contents": { - "$ref": "#/definitions/permissions-level" - }, - "deployments": { - "$ref": "#/definitions/permissions-level" - }, - "discussions": { - "$ref": "#/definitions/permissions-level" - }, - "id-token": { - "$ref": "#/definitions/permissions-level" - }, - "issues": { - "$ref": "#/definitions/permissions-level" - }, - "packages": { - "$ref": "#/definitions/permissions-level" - }, - "pages": { - "$ref": "#/definitions/permissions-level" - }, - "pull-requests": { - "$ref": "#/definitions/permissions-level" - }, - "repository-projects": { - "$ref": "#/definitions/permissions-level" - }, - "security-events": { - "$ref": "#/definitions/permissions-level" - }, - "statuses": { - "$ref": "#/definitions/permissions-level" - } - } - }, - "permissions-level": { - "type": "string", - "enum": ["read", "write", "none"] - }, - "env": { - "$comment": "https://docs.github.com/en/actions/learn-github-actions/environment-variables", - "description": "To set custom environment variables, you need to specify the variables in the workflow file. You can define environment variables for a step, job, or entire workflow using the jobs..steps[*].env, jobs..env, and env keywords. For more information, see https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsenv", - "oneOf": [ - { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "boolean" - } - ] - } - }, - { - "$ref": "#/definitions/stringContainingExpressionSyntax" - } - ] - }, - "environment": { - "$comment": "https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idenvironment", - "description": "The environment that the job references", - "type": "object", - "properties": { - "name": { - "$comment": "https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#example-using-a-single-environment-name", - "description": "The name of the environment configured in the repo.", - "type": "string" - }, - "url": { - "$comment": "https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#example-using-environment-name-and-url", - "description": "A deployment URL", - "type": "string" - } - }, - "required": ["name"], - "additionalProperties": false - }, - "event": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows", - "type": "string", - "enum": [ - "branch_protection_rule", - "check_run", - "check_suite", - "create", - "delete", - "deployment", - "deployment_status", - "discussion", - "discussion_comment", - "fork", - "gollum", - "issue_comment", - "issues", - "label", - "member", - "milestone", - "page_build", - "project", - "project_card", - "project_column", - "public", - "pull_request", - "pull_request_review", - "pull_request_review_comment", - "pull_request_target", - "push", - "registry_package", - "release", - "status", - "watch", - "workflow_call", - "workflow_dispatch", - "workflow_run", - "repository_dispatch" - ] - }, - "eventObject": { - "oneOf": [ - { - "type": "object" - }, - { - "type": "null" - } - ], - "additionalProperties": true - }, - "expressionSyntax": { - "type": "string", - "$comment": "escape `{` and `}` in pattern to be unicode compatible (#1360)", - "pattern": "^\\$\\{\\{(.|[\r\n])*\\}\\}$" - }, - "stringContainingExpressionSyntax": { - "type": "string", - "$comment": "escape `{` and `}` in pattern to be unicode compatible (#1360)", - "pattern": "^.*\\$\\{\\{(.|[\r\n])*\\}\\}.*$" - }, - "globs": { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - }, - "minItems": 1 - }, - "machine": { - "type": "string", - "enum": ["linux", "macos", "windows"] - }, - "name": { - "type": "string", - "pattern": "^[_a-zA-Z][a-zA-Z0-9_-]*$" - }, - "path": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpaths", - "$ref": "#/definitions/globs", - "description": "When using the push and pull_request events, you can configure a workflow to run when at least one file does not match paths-ignore or at least one modified file matches the configured paths. Path filters are not evaluated for pushes to tags.\nThe paths-ignore and paths keywords accept glob patterns that use the * and ** wildcard characters to match more than one path name. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet.\nYou can exclude paths using two types of filters. You cannot use both of these filters for the same event in a workflow.\n- paths-ignore - Use the paths-ignore filter when you only need to exclude path names.\n- paths - Use the paths filter when you need to filter paths for positive matches and exclude paths." - }, - "ref": { - "properties": { - "branches": { - "$ref": "#/definitions/branch" - }, - "branches-ignore": { - "$ref": "#/definitions/branch" - }, - "tags": { - "$ref": "#/definitions/branch" - }, - "tags-ignore": { - "$ref": "#/definitions/branch" - }, - "paths": { - "$ref": "#/definitions/path" - }, - "paths-ignore": { - "$ref": "#/definitions/path" - } - }, - "oneOf": [ - { - "type": "object", - "allOf": [ - { - "not": { - "required": ["branches", "branches-ignore"] - } - }, - { - "not": { - "required": ["tags", "tags-ignore"] - } - }, - { - "not": { - "required": ["paths", "paths-ignore"] - } - } - ] - }, - { - "type": "null" - } - ] - }, - "shell": { - "$comment": "https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell", - "description": "You can override the default shell settings in the runner's operating system using the shell keyword. You can use built-in shell keywords, or you can define a custom set of shell options.", - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#custom-shell", - "enum": ["bash", "pwsh", "python", "sh", "cmd", "powershell"] - } - ] - }, - "types": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#onevent_nametypes", - "description": "Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary.\nYou can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events.", - "type": "array", - "minItems": 1 - }, - "working-directory": { - "$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsrun", - "description": "Using the working-directory keyword, you can specify the working directory of where to run the command.", - "type": "string" - }, - "jobNeeds": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idneeds", - "description": "Identifies any jobs that must complete successfully before this job will run. It can be a string or array of strings. If a job fails, all jobs that need it are skipped unless the jobs use a conditional statement that causes the job to continue.", - "oneOf": [ - { - "type": "array", - "items": { - "$ref": "#/definitions/name" - }, - "minItems": 1 - }, - { - "$ref": "#/definitions/name" - } - ] - }, - "matrix": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix", - "description": "A build matrix is a set of different configurations of the virtual environment. For example you might run a job against more than one supported version of a language, operating system, or tool. Each configuration is a copy of the job that runs and reports a status.\nYou can specify a matrix by supplying an array for the configuration options. For example, if the GitHub virtual environment supports Node.js versions 6, 8, and 10 you could specify an array of those versions in the matrix.\nWhen you define a matrix of operating systems, you must set the required runs-on keyword to the operating system of the current job, rather than hard-coding the operating system name. To access the operating system name, you can use the matrix.os context parameter to set runs-on. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.", - "oneOf": [ - { - "type": "object" - }, - { - "$ref": "#/definitions/expressionSyntax" - } - ], - "patternProperties": { - "^(in|ex)clude$": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#example-including-configurations-in-a-matrix-build", - "oneOf": [ - { - "$ref": "#/definitions/expressionSyntax" - }, - { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/configuration" - } - }, - "minItems": 1 - } - ] - } - }, - "additionalProperties": { - "oneOf": [ - { - "type": "array", - "items": { - "$ref": "#/definitions/configuration" - }, - "minItems": 1 - }, - { - "$ref": "#/definitions/expressionSyntax" - } - ] - }, - "minProperties": 1 - }, - "reusableWorkflowCallJob": { - "$comment": "https://docs.github.com/en/actions/learn-github-actions/reusing-workflows#calling-a-reusable-workflow", - "description": "Each job must have an id to associate with the job. The key job_id is a string and its value is a map of the job's configuration data. You must replace with a string that is unique to the jobs object. The must start with a letter or _ and contain only alphanumeric characters, -, or _.", - "type": "object", - "properties": { - "name": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idname", - "description": "The name of the job displayed on GitHub.", - "type": "string" - }, - "needs": { - "$ref": "#/definitions/jobNeeds" - }, - "permissions": { - "$ref": "#/definitions/permissions-event" - }, - "if": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idif", - "description": "You can use the if conditional to prevent a job from running unless a condition is met. You can use any supported context and expression to create a conditional.\nExpressions in an if conditional do not require the ${{ }} syntax. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.", - "type": ["boolean", "number", "string"] - }, - "uses": { - "$comment": "https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_iduses", - "description": "The location and version of a reusable workflow file to run as a job, of the form './{path/to}/{localfile}.yml' or '{owner}/{repo}/{path}/{filename}@{ref}'. {ref} can be a SHA, a release tag, or a branch name. Using the commit SHA is the safest for stability and security.", - "type": "string", - "pattern": "^(.+/)+(.+)\\.(ya?ml)(@.+)?$" - }, - "with": { - "$comment": "https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idwith", - "description": "A map of inputs that are passed to the called workflow. Any inputs that you pass must match the input specifications defined in the called workflow. Unlike 'jobs..steps[*].with', the inputs you pass with 'jobs..with' are not be available as environment variables in the called workflow. Instead, you can reference the inputs by using the inputs context.", - "$ref": "#/definitions/env" - }, - "secrets": { - "$comment": "https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idsecrets", - "description": "When a job is used to call a reusable workflow, you can use 'secrets' to provide a map of secrets that are passed to the called workflow. Any secrets that you pass must match the names defined in the called workflow.", - "oneOf": [ - { - "$ref": "#/definitions/env" - }, - { - "type": "string", - "enum": ["inherit"] - } - ] - }, - "strategy": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategy", - "description": "A strategy creates a build matrix for your jobs. You can define different variations of an environment to run each job in.", - "type": "object", - "properties": { - "matrix": { - "$ref": "#/definitions/matrix" - }, - "fail-fast": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast", - "description": "When set to true, GitHub cancels all in-progress jobs if any matrix job fails. Default: true", - "type": ["boolean", "string"], - "default": true - }, - "max-parallel": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategymax-parallel", - "description": "The maximum number of jobs that can run simultaneously when using a matrix job strategy. By default, GitHub will maximize the number of jobs run in parallel depending on the available runners on GitHub-hosted virtual machines.", - "type": ["number", "string"] - } - }, - "required": ["matrix"], - "additionalProperties": false - }, - "concurrency": { - "$comment": "https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idconcurrency", - "description": "Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time. A concurrency group can be any string or expression. The expression can use any context except for the secrets context. \nYou can also specify concurrency at the workflow level. \nWhen a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the repository is in progress, the queued job or workflow will be pending. Any previously pending job or workflow in the concurrency group will be canceled. To also cancel any currently running job or workflow in the same concurrency group, specify cancel-in-progress: true.", - "oneOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/concurrency" - } - ] - } - }, - "required": ["uses"], - "additionalProperties": false - }, - "normalJob": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_id", - "description": "Each job must have an id to associate with the job. The key job_id is a string and its value is a map of the job's configuration data. You must replace with a string that is unique to the jobs object. The must start with a letter or _ and contain only alphanumeric characters, -, or _.", - "type": "object", - "properties": { - "name": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idname", - "description": "The name of the job displayed on GitHub.", - "type": "string" - }, - "needs": { - "$ref": "#/definitions/jobNeeds" - }, - "permissions": { - "$ref": "#/definitions/permissions" - }, - "runs-on": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idruns-on", - "description": "The type of machine to run the job on. The machine can be either a GitHub-hosted runner, or a self-hosted runner.", - "anyOf": [ - { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#github-hosted-runners", - "type": "string" - }, - { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#self-hosted-runners", - "type": "array", - "anyOf": [ - { - "items": [ - { - "type": "string" - } - ], - "minItems": 1 - } - ] - }, - { - "$comment": "https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-runners-in-a-group", - "type": "object", - "properties": { - "group": { - "type": "string" - }, - "labels": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - } - } - }, - { - "$ref": "#/definitions/stringContainingExpressionSyntax" - }, - { - "$ref": "#/definitions/expressionSyntax" - } - ] - }, - "environment": { - "$comment": "https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idenvironment", - "description": "The environment that the job references.", - "oneOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/environment" - } - ] - }, - "outputs": { - "$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjobs_idoutputs", - "description": "A map of outputs for a job. Job outputs are available to all downstream jobs that depend on this job.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "minProperties": 1 - }, - "env": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idenv", - "$ref": "#/definitions/env", - "description": "A map of environment variables that are available to all steps in the job." - }, - "defaults": { - "$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_iddefaults", - "$ref": "#/definitions/defaults", - "description": "A map of default settings that will apply to all steps in the job." - }, - "if": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idif", - "description": "You can use the if conditional to prevent a job from running unless a condition is met. You can use any supported context and expression to create a conditional.\nExpressions in an if conditional do not require the ${{ }} syntax. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.", - "type": ["boolean", "number", "string"] - }, - "steps": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idsteps", - "description": "A job contains a sequence of tasks called steps. Steps can run commands, run setup tasks, or run an action in your repository, a public repository, or an action published in a Docker registry. Not all steps run actions, but all actions run as a step. Each step runs in its own process in the virtual environment and has access to the workspace and filesystem. Because steps run in their own process, changes to environment variables are not preserved between steps. GitHub provides built-in steps to set up and complete a job.\nMust contain either `uses` or `run`\n", - "type": "array", - "items": { - "allOf": [ - { - "oneOf": [ - { - "type": "object", - "properties": { - "uses": { - "type": "string" - } - }, - "required": ["uses"] - }, - { - "type": "object", - "properties": { - "run": { - "type": "string" - } - }, - "required": ["run"] - } - ] - }, - { - "type": "object", - "properties": { - "id": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsid", - "description": "A unique identifier for the step. You can use the id to reference the step in contexts. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.", - "type": "string" - }, - "if": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsif", - "description": "You can use the if conditional to prevent a step from running unless a condition is met. You can use any supported context and expression to create a conditional.\nExpressions in an if conditional do not require the ${{ }} syntax. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.", - "type": ["boolean", "number", "string"] - }, - "name": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsname", - "description": "A name for your step to display on GitHub.", - "type": "string" - }, - "uses": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsuses", - "description": "Selects an action to run as part of a step in your job. An action is a reusable unit of code. You can use an action defined in the same repository as the workflow, a public repository, or in a published Docker container image (https://hub.docker.com/).\nWe strongly recommend that you include the version of the action you are using by specifying a Git ref, SHA, or Docker tag number. If you don't specify a version, it could break your workflows or cause unexpected behavior when the action owner publishes an update.\n- Using the commit SHA of a released action version is the safest for stability and security.\n- Using the specific major action version allows you to receive critical fixes and security patches while still maintaining compatibility. It also assures that your workflow should still work.\n- Using the master branch of an action may be convenient, but if someone releases a new major version with a breaking change, your workflow could break.\nSome actions require inputs that you must set using the with keyword. Review the action's README file to determine the inputs required.\nActions are either JavaScript files or Docker containers. If the action you're using is a Docker container you must run the job in a Linux virtual environment. For more details, see https://help.github.com/en/articles/virtual-environments-for-github-actions.", - "type": "string" - }, - "run": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsrun", - "description": "Runs command-line programs using the operating system's shell. If you do not provide a name, the step name will default to the text specified in the run command.\nCommands run using non-login shells by default. You can choose a different shell and customize the shell used to run commands. For more information, see https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#using-a-specific-shell.\nEach run keyword represents a new process and shell in the virtual environment. When you provide multi-line commands, each line runs in the same shell.", - "type": "string" - }, - "working-directory": { - "$ref": "#/definitions/working-directory" - }, - "shell": { - "$ref": "#/definitions/shell" - }, - "with": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepswith", - "$ref": "#/definitions/env", - "description": "A map of the input parameters defined by the action. Each input parameter is a key/value pair. Input parameters are set as environment variables. The variable is prefixed with INPUT_ and converted to upper case.", - "properties": { - "args": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepswithargs", - "type": "string" - }, - "entrypoint": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepswithentrypoint", - "type": "string" - } - } - }, - "env": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsenv", - "$ref": "#/definitions/env", - "description": "Sets environment variables for steps to use in the virtual environment. You can also set environment variables for the entire workflow or a job." - }, - "continue-on-error": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error", - "description": "Prevents a job from failing when a step fails. Set to true to allow a job to pass when this step fails.", - "oneOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/expressionSyntax" - } - ], - "default": false - }, - "timeout-minutes": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepstimeout-minutes", - "description": "The maximum number of minutes to run the step before killing the process.", - "oneOf": [ - { - "type": "number" - }, - { - "$ref": "#/definitions/expressionSyntax" - } - ] - } - }, - "dependencies": { - "working-directory": ["run"], - "shell": ["run"] - }, - "additionalProperties": false - } - ] - }, - "minItems": 1 - }, - "timeout-minutes": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idtimeout-minutes", - "description": "The maximum number of minutes to let a workflow run before GitHub automatically cancels it. Default: 360", - "oneOf": [ - { - "type": "number" - }, - { - "$ref": "#/definitions/expressionSyntax" - } - ], - "default": 360 - }, - "strategy": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategy", - "description": "A strategy creates a build matrix for your jobs. You can define different variations of an environment to run each job in.", - "type": "object", - "properties": { - "matrix": { - "$ref": "#/definitions/matrix" - }, - "fail-fast": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast", - "description": "When set to true, GitHub cancels all in-progress jobs if any matrix job fails. Default: true", - "type": ["boolean", "string"], - "default": true - }, - "max-parallel": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategymax-parallel", - "description": "The maximum number of jobs that can run simultaneously when using a matrix job strategy. By default, GitHub will maximize the number of jobs run in parallel depending on the available runners on GitHub-hosted virtual machines.", - "type": ["number", "string"] - } - }, - "required": ["matrix"], - "additionalProperties": false - }, - "continue-on-error": { - "$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idcontinue-on-error", - "description": "Prevents a workflow run from failing when a job fails. Set to true to allow a workflow run to pass when this job fails.", - "oneOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/expressionSyntax" - } - ] - }, - "container": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idcontainer", - "description": "A container to run any steps in a job that don't already specify a container. If you have steps that use both script and container actions, the container actions will run as sibling containers on the same network with the same volume mounts.\nIf you do not set a container, all steps will run directly on the host specified by runs-on unless a step refers to an action configured to run in a container.", - "oneOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/container" - } - ] - }, - "services": { - "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idservices", - "description": "Additional containers to host services for a job in a workflow. These are useful for creating databases or cache services like redis. The runner on the virtual machine will automatically create a network and manage the life cycle of the service containers.\nWhen you use a service container for a job or your step uses container actions, you don't need to set port information to access the service. Docker automatically exposes all ports between containers on the same network.\nWhen both the job and the action run in a container, you can directly reference the container by its hostname. The hostname is automatically mapped to the service name.\nWhen a step does not use a container action, you must access the service using localhost and bind the ports.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/container" - } - }, - "concurrency": { - "$comment": "https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idconcurrency", - "description": "Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time. A concurrency group can be any string or expression. The expression can use any context except for the secrets context. \nYou can also specify concurrency at the workflow level. \nWhen a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the repository is in progress, the queued job or workflow will be pending. Any previously pending job or workflow in the concurrency group will be canceled. To also cancel any currently running job or workflow in the same concurrency group, specify cancel-in-progress: true.", - "oneOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/concurrency" - } - ] - } - }, - "required": ["runs-on"], - "additionalProperties": false - } - }, - "properties": { - "name": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#name", - "description": "The name of your workflow. GitHub displays the names of your workflows on your repository's actions page. If you omit this field, GitHub sets the name to the workflow's filename.", - "type": "string" - }, - "on": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#on", - "description": "The name of the GitHub event that triggers the workflow. You can provide a single event string, array of events, array of event types, or an event configuration map that schedules a workflow or restricts the execution of a workflow to specific files, tags, or branch changes. For a list of available events, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows.", - "oneOf": [ - { - "$ref": "#/definitions/event" - }, - { - "type": "array", - "items": { - "$ref": "#/definitions/event" - }, - "minItems": 1 - }, - { - "type": "object", - "properties": { - "branch_protection_rule": { - "$comment": "https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#branch_protection_rule", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime the branch_protection_rule event occurs. More than one activity type triggers this event.", - "properties": { - "types": { - "$ref": "#/definitions/types", - "items": { - "type": "string", - "enum": ["created", "edited", "deleted"] - }, - "default": ["created", "edited", "deleted"] - } - } - }, - "check_run": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#check-run-event-check_run", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime the check_run event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/checks/runs.", - "properties": { - "types": { - "$ref": "#/definitions/types", - "items": { - "type": "string", - "enum": [ - "created", - "rerequested", - "completed", - "requested_action" - ] - }, - "default": [ - "created", - "rerequested", - "completed", - "requested_action" - ] - } - } - }, - "check_suite": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#check-suite-event-check_suite", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime the check_suite event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/checks/suites/.", - "properties": { - "types": { - "$ref": "#/definitions/types", - "items": { - "type": "string", - "enum": ["completed", "requested", "rerequested"] - }, - "default": ["completed", "requested", "rerequested"] - } - } - }, - "create": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#create-event-create", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime someone creates a branch or tag, which triggers the create event. For information about the REST API, see https://developer.github.com/v3/git/refs/#create-a-reference." - }, - "delete": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#delete-event-delete", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime someone deletes a branch or tag, which triggers the delete event. For information about the REST API, see https://developer.github.com/v3/git/refs/#delete-a-reference." - }, - "deployment": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#deployment-event-deployment", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime someone creates a deployment, which triggers the deployment event. Deployments created with a commit SHA may not have a Git ref. For information about the REST API, see https://developer.github.com/v3/repos/deployments/." - }, - "deployment_status": { - "$comment": "https://docs.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime a third party provides a deployment status, which triggers the deployment_status event. Deployments created with a commit SHA may not have a Git ref. For information about the REST API, see https://developer.github.com/v3/repos/deployments/#create-a-deployment-status." - }, - "discussion": { - "$comment": "https://docs.github.com/en/actions/reference/events-that-trigger-workflows#discussion", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime the discussion event occurs. More than one activity type triggers this event. For information about the GraphQL API, see https://docs.github.com/en/graphql/guides/using-the-graphql-api-for-discussions", - "properties": { - "types": { - "$ref": "#/definitions/types", - "items": { - "type": "string", - "enum": [ - "created", - "edited", - "deleted", - "transferred", - "pinned", - "unpinned", - "labeled", - "unlabeled", - "locked", - "unlocked", - "category_changed", - "answered", - "unanswered" - ] - }, - "default": [ - "created", - "edited", - "deleted", - "transferred", - "pinned", - "unpinned", - "labeled", - "unlabeled", - "locked", - "unlocked", - "category_changed", - "answered", - "unanswered" - ] - } - } - }, - "discussion_comment": { - "$comment": "https://docs.github.com/en/actions/reference/events-that-trigger-workflows#discussion_comment", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime the discussion_comment event occurs. More than one activity type triggers this event. For information about the GraphQL API, see https://docs.github.com/en/graphql/guides/using-the-graphql-api-for-discussions", - "properties": { - "types": { - "$ref": "#/definitions/types", - "items": { - "type": "string", - "enum": ["created", "edited", "deleted"] - }, - "default": ["created", "edited", "deleted"] - } - } - }, - "fork": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#fork-event-fork", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime when someone forks a repository, which triggers the fork event. For information about the REST API, see https://developer.github.com/v3/repos/forks/#create-a-fork." - }, - "gollum": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#gollum-event-gollum", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow when someone creates or updates a Wiki page, which triggers the gollum event." - }, - "issue_comment": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#issue-comment-event-issue_comment", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime the issue_comment event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues/comments/.", - "properties": { - "types": { - "$ref": "#/definitions/types", - "items": { - "type": "string", - "enum": ["created", "edited", "deleted"] - }, - "default": ["created", "edited", "deleted"] - } - } - }, - "issues": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#issues-event-issues", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime the issues event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues.", - "properties": { - "types": { - "$ref": "#/definitions/types", - "items": { - "type": "string", - "enum": [ - "opened", - "edited", - "deleted", - "transferred", - "pinned", - "unpinned", - "closed", - "reopened", - "assigned", - "unassigned", - "labeled", - "unlabeled", - "locked", - "unlocked", - "milestoned", - "demilestoned" - ] - }, - "default": [ - "opened", - "edited", - "deleted", - "transferred", - "pinned", - "unpinned", - "closed", - "reopened", - "assigned", - "unassigned", - "labeled", - "unlabeled", - "locked", - "unlocked", - "milestoned", - "demilestoned" - ] - } - } - }, - "label": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#label-event-label", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime the label event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues/labels/.", - "properties": { - "types": { - "$ref": "#/definitions/types", - "items": { - "type": "string", - "enum": ["created", "edited", "deleted"] - }, - "default": ["created", "edited", "deleted"] - } - } - }, - "member": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#member-event-member", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime the member event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/repos/collaborators/.", - "properties": { - "types": { - "$ref": "#/definitions/types", - "items": { - "type": "string", - "enum": ["added", "edited", "deleted"] - }, - "default": ["added", "edited", "deleted"] - } - } - }, - "merge_group": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#merge_group", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow when a pull request is added to a merge queue, which adds the pull request to a merge group. For information about the merge queue, see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/merging-a-pull-request-with-a-merge-queue .", - "properties": { - "types": { - "$ref": "#/definitions/types", - "items": { - "type": "string", - "enum": ["checks_requested"] - }, - "default": ["checks_requested"] - } - } - }, - "milestone": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#milestone-event-milestone", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime the milestone event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues/milestones/.", - "properties": { - "types": { - "$ref": "#/definitions/types", - "items": { - "type": "string", - "enum": ["created", "closed", "opened", "edited", "deleted"] - }, - "default": [ - "created", - "closed", - "opened", - "edited", - "deleted" - ] - } - } - }, - "page_build": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#page-build-event-page_build", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime someone pushes to a GitHub Pages-enabled branch, which triggers the page_build event. For information about the REST API, see https://developer.github.com/v3/repos/pages/." - }, - "project": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#project-event-project", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime the project event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/projects/.", - "properties": { - "types": { - "$ref": "#/definitions/types", - "items": { - "type": "string", - "enum": [ - "created", - "updated", - "closed", - "reopened", - "edited", - "deleted" - ] - }, - "default": [ - "created", - "updated", - "closed", - "reopened", - "edited", - "deleted" - ] - } - } - }, - "project_card": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#project-card-event-project_card", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime the project_card event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/projects/cards.", - "properties": { - "types": { - "$ref": "#/definitions/types", - "items": { - "type": "string", - "enum": [ - "created", - "moved", - "converted", - "edited", - "deleted" - ] - }, - "default": [ - "created", - "moved", - "converted", - "edited", - "deleted" - ] - } - } - }, - "project_column": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#project-column-event-project_column", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime the project_column event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/projects/columns.", - "properties": { - "types": { - "$ref": "#/definitions/types", - "items": { - "type": "string", - "enum": ["created", "updated", "moved", "deleted"] - }, - "default": ["created", "updated", "moved", "deleted"] - } - } - }, - "public": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#public-event-public", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime someone makes a private repository public, which triggers the public event. For information about the REST API, see https://developer.github.com/v3/repos/#edit." - }, - "pull_request": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#pull-request-event-pull_request", - "$ref": "#/definitions/ref", - "description": "Runs your workflow anytime the pull_request event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/pulls.\nNote: Workflows do not run on private base repositories when you open a pull request from a forked repository.\nWhen you create a pull request from a forked repository to the base repository, GitHub sends the pull_request event to the base repository and no pull request events occur on the forked repository.\nWorkflows don't run on forked repositories by default. You must enable GitHub Actions in the Actions tab of the forked repository.\nThe permissions for the GITHUB_TOKEN in forked repositories is read-only. For more information about the GITHUB_TOKEN, see https://help.github.com/en/articles/virtual-environments-for-github-actions.", - "properties": { - "types": { - "$ref": "#/definitions/types", - "items": { - "type": "string", - "enum": [ - "assigned", - "unassigned", - "labeled", - "unlabeled", - "opened", - "edited", - "closed", - "reopened", - "synchronize", - "converted_to_draft", - "ready_for_review", - "locked", - "unlocked", - "review_requested", - "review_request_removed", - "auto_merge_enabled", - "auto_merge_disabled" - ] - }, - "default": ["opened", "synchronize", "reopened"] - } - }, - "patternProperties": { - "^(branche|tag|path)s(-ignore)?$": { - "type": "array" - } - }, - "additionalProperties": false - }, - "pull_request_review": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#pull-request-review-event-pull_request_review", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime the pull_request_review event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/pulls/reviews.\nNote: Workflows do not run on private base repositories when you open a pull request from a forked repository.\nWhen you create a pull request from a forked repository to the base repository, GitHub sends the pull_request event to the base repository and no pull request events occur on the forked repository.\nWorkflows don't run on forked repositories by default. You must enable GitHub Actions in the Actions tab of the forked repository.\nThe permissions for the GITHUB_TOKEN in forked repositories is read-only. For more information about the GITHUB_TOKEN, see https://help.github.com/en/articles/virtual-environments-for-github-actions.", - "properties": { - "types": { - "$ref": "#/definitions/types", - "items": { - "type": "string", - "enum": ["submitted", "edited", "dismissed"] - }, - "default": ["submitted", "edited", "dismissed"] - } - } - }, - "pull_request_review_comment": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#pull-request-review-comment-event-pull_request_review_comment", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime a comment on a pull request's unified diff is modified, which triggers the pull_request_review_comment event. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/pulls/comments.\nNote: Workflows do not run on private base repositories when you open a pull request from a forked repository.\nWhen you create a pull request from a forked repository to the base repository, GitHub sends the pull_request event to the base repository and no pull request events occur on the forked repository.\nWorkflows don't run on forked repositories by default. You must enable GitHub Actions in the Actions tab of the forked repository.\nThe permissions for the GITHUB_TOKEN in forked repositories is read-only. For more information about the GITHUB_TOKEN, see https://help.github.com/en/articles/virtual-environments-for-github-actions.", - "properties": { - "types": { - "$ref": "#/definitions/types", - "items": { - "type": "string", - "enum": ["created", "edited", "deleted"] - }, - "default": ["created", "edited", "deleted"] - } - } - }, - "pull_request_target": { - "$comment": "https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target", - "$ref": "#/definitions/ref", - "description": "This event is similar to pull_request, except that it runs in the context of the base repository of the pull request, rather than in the merge commit. This means that you can more safely make your secrets available to the workflows triggered by the pull request, because only workflows defined in the commit on the base repository are run. For example, this event allows you to create workflows that label and comment on pull requests, based on the contents of the event payload.", - "properties": { - "types": { - "$ref": "#/definitions/types", - "items": { - "type": "string", - "enum": [ - "assigned", - "unassigned", - "labeled", - "unlabeled", - "opened", - "edited", - "closed", - "reopened", - "synchronize", - "converted_to_draft", - "ready_for_review", - "locked", - "unlocked", - "review_requested", - "review_request_removed", - "auto_merge_enabled", - "auto_merge_disabled" - ] - }, - "default": ["opened", "synchronize", "reopened"] - } - }, - "patternProperties": { - "^(branche|tag|path)s(-ignore)?$": {} - }, - "additionalProperties": false - }, - "push": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#push-event-push", - "$ref": "#/definitions/ref", - "description": "Runs your workflow when someone pushes to a repository branch, which triggers the push event.\nNote: The webhook payload available to GitHub Actions does not include the added, removed, and modified attributes in the commit object. You can retrieve the full commit object using the REST API. For more information, see https://developer.github.com/v3/repos/commits/#get-a-single-commit.", - "patternProperties": { - "^(branche|tag|path)s(-ignore)?$": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "additionalProperties": false - }, - "registry_package": { - "$comment": "https://help.github.com/en/actions/reference/events-that-trigger-workflows#registry-package-event-registry_package", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime a package is published or updated. For more information, see https://help.github.com/en/github/managing-packages-with-github-packages.", - "properties": { - "types": { - "$ref": "#/definitions/types", - "items": { - "type": "string", - "enum": ["published", "updated"] - }, - "default": ["published", "updated"] - } - } - }, - "release": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#release-event-release", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime the release event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/repos/releases/ in the GitHub Developer documentation.", - "properties": { - "types": { - "$ref": "#/definitions/types", - "items": { - "type": "string", - "enum": [ - "published", - "unpublished", - "created", - "edited", - "deleted", - "prereleased", - "released" - ] - }, - "default": [ - "published", - "unpublished", - "created", - "edited", - "deleted", - "prereleased", - "released" - ] - } - } - }, - "status": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#status-event-status", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime the status of a Git commit changes, which triggers the status event. For information about the REST API, see https://developer.github.com/v3/repos/statuses/." - }, - "watch": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#watch-event-watch", - "$ref": "#/definitions/eventObject", - "description": "Runs your workflow anytime the watch event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/activity/starring/." - }, - "workflow_call": { - "$comment": "https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#workflow_call", - "description": "Allows workflows to be reused by other workflows.", - "properties": { - "inputs": { - "$comment": "https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onworkflow_callinputs", - "description": "When using the workflow_call keyword, you can optionally specify inputs that are passed to the called workflow from the caller workflow.", - "type": "object", - "patternProperties": { - "^[_a-zA-Z][a-zA-Z0-9_-]*$": { - "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputsinput_id", - "description": "A string identifier to associate with the input. The value of is a map of the input's metadata. The must be a unique identifier within the inputs object. The must start with a letter or _ and contain only alphanumeric characters, -, or _.", - "type": "object", - "properties": { - "description": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_iddescription", - "description": "A string description of the input parameter.", - "type": "string" - }, - "deprecationMessage": { - "description": "A string shown to users using the deprecated input.", - "type": "string" - }, - "required": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_idrequired", - "description": "A boolean to indicate whether the action requires the input parameter. Set to true when the parameter is required.", - "type": "boolean" - }, - "type": { - "$comment": "https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onworkflow_callinput_idtype", - "description": "Required if input is defined for the on.workflow_call keyword. The value of this parameter is a string specifying the data type of the input. This must be one of: boolean, number, or string.", - "type": "string", - "enum": ["boolean", "number", "string"] - }, - "default": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_iddefault", - "description": "The default value is used when an input parameter isn't specified in a workflow file.", - "type": ["boolean", "number", "string"] - } - }, - "required": ["type"], - "additionalProperties": false - } - }, - "additionalProperties": false - }, - "secrets": { - "$comment": "https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onworkflow_callsecrets", - "description": "A map of the secrets that can be used in the called workflow. Within the called workflow, you can use the secrets context to refer to a secret.", - "patternProperties": { - "^[_a-zA-Z][a-zA-Z0-9_-]*$": { - "$comment": "https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onworkflow_callsecretssecret_id", - "description": "A string identifier to associate with the secret.", - "properties": { - "description": { - "description": "A string description of the secret parameter.", - "type": "string" - }, - "required": { - "$comment": "https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onworkflow_callsecretssecret_idrequired", - "description": "A boolean specifying whether the secret must be supplied.", - "type": "boolean" - } - }, - "required": ["required"], - "additionalProperties": false - } - }, - "additionalProperties": false - } - } - }, - "workflow_dispatch": { - "$comment": "https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/", - "description": "You can now create workflows that are manually triggered with the new workflow_dispatch event. You will then see a 'Run workflow' button on the Actions tab, enabling you to easily trigger a run.", - "properties": { - "inputs": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputs", - "description": "Input parameters allow you to specify data that the action expects to use during runtime. GitHub stores input parameters as environment variables. Input ids with uppercase letters are converted to lowercase during runtime. We recommended using lowercase input ids.", - "type": "object", - "patternProperties": { - "^[_a-zA-Z][a-zA-Z0-9_-]*$": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_id", - "description": "A string identifier to associate with the input. The value of is a map of the input's metadata. The must be a unique identifier within the inputs object. The must start with a letter or _ and contain only alphanumeric characters, -, or _.", - "type": "object", - "properties": { - "description": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_iddescription", - "description": "A string description of the input parameter.", - "type": "string" - }, - "deprecationMessage": { - "description": "A string shown to users using the deprecated input.", - "type": "string" - }, - "required": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_idrequired", - "description": "A boolean to indicate whether the action requires the input parameter. Set to true when the parameter is required.", - "type": "boolean" - }, - "default": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_iddefault", - "description": "A string representing the default value. The default value is used when an input parameter isn't specified in a workflow file." - }, - "type": { - "description": "A string representing the type of the input.", - "$comment": "https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_dispatchinputsinput_idtype", - "type": "string", - "enum": [ - "string", - "choice", - "boolean", - "number", - "environment" - ] - }, - "options": { - "$comment": "https://github.blog/changelog/2021-11-10-github-actions-input-types-for-manual-workflows", - "description": "The options of the dropdown list, if the type is a choice.", - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1 - } - }, - "allOf": [ - { - "if": { - "properties": { - "type": { - "const": "string" - } - }, - "required": ["type"] - }, - "then": { - "properties": { - "default": { - "type": "string" - } - } - } - }, - { - "if": { - "properties": { - "type": { - "const": "boolean" - } - }, - "required": ["type"] - }, - "then": { - "properties": { - "default": { - "type": "boolean" - } - } - } - }, - { - "if": { - "properties": { - "type": { - "const": "number" - } - }, - "required": ["type"] - }, - "then": { - "properties": { - "default": { - "type": "number" - } - } - } - }, - { - "if": { - "properties": { - "type": { - "const": "environment" - } - }, - "required": ["type"] - }, - "then": { - "properties": { - "default": { - "type": "string" - } - } - } - }, - { - "if": { - "properties": { - "type": { - "const": "choice" - } - }, - "required": ["type"] - }, - "then": { - "required": ["options"] - } - } - ], - "required": ["description"], - "additionalProperties": false - } - }, - "additionalProperties": false - } - } - }, - "workflow_run": { - "$comment": "https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_run", - "$ref": "#/definitions/eventObject", - "description": "This event occurs when a workflow run is requested or completed, and allows you to execute a workflow based on the finished result of another workflow. For example, if your pull_request workflow generates build artifacts, you can create a new workflow that uses workflow_run to analyze the results and add a comment to the original pull request.", - "properties": { - "types": { - "$ref": "#/definitions/types", - "items": { - "type": "string", - "enum": ["requested", "completed"] - }, - "default": ["requested", "completed"] - }, - "workflows": { - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1 - } - }, - "patternProperties": { - "^branches(-ignore)?$": {} - } - }, - "repository_dispatch": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#external-events-repository_dispatch", - "$ref": "#/definitions/eventObject", - "description": "You can use the GitHub API to trigger a webhook event called repository_dispatch when you want to trigger a workflow for activity that happens outside of GitHub. For more information, see https://developer.github.com/v3/repos/#create-a-repository-dispatch-event.\nTo trigger the custom repository_dispatch webhook event, you must send a POST request to a GitHub API endpoint and provide an event_type name to describe the activity type. To trigger a workflow run, you must also configure your workflow to use the repository_dispatch event." - }, - "schedule": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#scheduled-events-schedule", - "description": "You can schedule a workflow to run at specific UTC times using POSIX cron syntax (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07). Scheduled workflows run on the latest commit on the default or base branch. The shortest interval you can run scheduled workflows is once every 5 minutes.\nNote: GitHub Actions does not support the non-standard syntax @yearly, @monthly, @weekly, @daily, @hourly, and @reboot.\nYou can use crontab guru (https://crontab.guru/). to help generate your cron syntax and confirm what time it will run. To help you get started, there is also a list of crontab guru examples (https://crontab.guru/examples.html).", - "type": "array", - "items": { - "properties": { - "cron": { - "$comment": "https://stackoverflow.com/a/57639657/4044345", - "type": "string", - "pattern": "^(((\\d+,)+\\d+|((\\d+|\\*)/\\d+|((JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)(-(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))?))|(\\d+-\\d+)|\\d+(-\\d+)?/\\d+(-\\d+)?|\\d+|\\*|(MON|TUE|WED|THU|FRI|SAT|SUN)(-(MON|TUE|WED|THU|FRI|SAT|SUN))?) ?){5}$" - } - }, - "additionalProperties": false - }, - "minItems": 1 - } - }, - "additionalProperties": false - } - ] - }, - "env": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#env", - "$ref": "#/definitions/env", - "description": "A map of environment variables that are available to all jobs and steps in the workflow." - }, - "defaults": { - "$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#defaults", - "$ref": "#/definitions/defaults", - "description": "A map of default settings that will apply to all jobs in the workflow." - }, - "concurrency": { - "$comment": "https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency", - "description": "Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time. A concurrency group can be any string or expression. The expression can use any context except for the secrets context. \nYou can also specify concurrency at the workflow level. \nWhen a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the repository is in progress, the queued job or workflow will be pending. Any previously pending job or workflow in the concurrency group will be canceled. To also cancel any currently running job or workflow in the same concurrency group, specify cancel-in-progress: true.", - "oneOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/concurrency" - } - ] - }, - "jobs": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobs", - "description": "A workflow run is made up of one or more jobs. Jobs run in parallel by default. To run jobs sequentially, you can define dependencies on other jobs using the jobs..needs keyword.\nEach job runs in a fresh instance of the virtual environment specified by runs-on.\nYou can run an unlimited number of jobs as long as you are within the workflow usage limits. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#usage-limits.", - "type": "object", - "patternProperties": { - "^[_a-zA-Z][a-zA-Z0-9_-]*$": { - "oneOf": [ - { - "$ref": "#/definitions/normalJob" - }, - { - "$ref": "#/definitions/reusableWorkflowCallJob" - } - ] - } - }, - "minProperties": 1, - "additionalProperties": false - }, - "run-name": { - "$comment": "https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#run-name", - "description": "The name for workflow runs generated from the workflow. GitHub displays the workflow run name in the list of workflow runs on your repository's 'Actions' tab.", - "type": "string" - }, - "permissions": { - "$ref": "#/definitions/permissions" - } - }, - "required": ["on", "jobs"], - "type": "object" -} +{ + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions", + "$id": "https://json.schemastore.org/github-workflow.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "definitions": { + "architecture": { + "type": "string", + "enum": ["ARM32", "x64", "x86"] + }, + "branch": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#onpushpull_requestbranchestags", + "$ref": "#/definitions/globs", + "description": "When using the push and pull_request events, you can configure a workflow to run on specific branches or tags. If you only define only tags or only branches, the workflow won't run for events affecting the undefined Git ref.\nThe branches, branches-ignore, tags, and tags-ignore keywords accept glob patterns that use the * and ** wildcard characters to match more than one branch or tag name. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet.\nThe patterns defined in branches and tags are evaluated against the Git ref's name. For example, defining the pattern mona/octocat in branches will match the refs/heads/mona/octocat Git ref. The pattern releases/** will match the refs/heads/releases/10 Git ref.\nYou can use two types of filters to prevent a workflow from running on pushes and pull requests to tags and branches:\n- branches or branches-ignore - You cannot use both the branches and branches-ignore filters for the same event in a workflow. Use the branches filter when you need to filter branches for positive matches and exclude branches. Use the branches-ignore filter when you only need to exclude branch names.\n- tags or tags-ignore - You cannot use both the tags and tags-ignore filters for the same event in a workflow. Use the tags filter when you need to filter tags for positive matches and exclude tags. Use the tags-ignore filter when you only need to exclude tag names.\nYou can exclude tags and branches using the ! character. The order that you define patterns matters.\n- A matching negative pattern (prefixed with !) after a positive match will exclude the Git ref.\n- A matching positive pattern after a negative match will include the Git ref again." + }, + "concurrency": { + "type": "object", + "properties": { + "group": { + "$comment": "https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-using-concurrency-to-cancel-any-in-progress-job-or-run-1", + "description": "When a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the repository is in progress, the queued job or workflow will be pending. Any previously pending job or workflow in the concurrency group will be canceled.", + "type": "string" + }, + "cancel-in-progress": { + "$comment": "https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-using-concurrency-to-cancel-any-in-progress-job-or-run-1", + "description": "To cancel any currently running job or workflow in the same concurrency group, specify cancel-in-progress: true.", + "oneOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/expressionSyntax" + } + ] + } + }, + "required": ["group"], + "additionalProperties": false + }, + "configuration": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/configuration" + } + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/configuration" + } + } + ] + }, + "container": { + "type": "object", + "properties": { + "image": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idcontainerimage", + "description": "The Docker image to use as the container to run the action. The value can be the Docker Hub image name or a registry name.", + "type": "string" + }, + "credentials": { + "$comment": "https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idcontainercredentials", + "description": "If the image's container registry requires authentication to pull the image, you can use credentials to set a map of the username and password. The credentials are the same values that you would provide to the `docker login` command.", + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "password": { + "type": "string" + } + } + }, + "env": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idcontainerenv", + "$ref": "#/definitions/env", + "description": "Sets an array of environment variables in the container." + }, + "ports": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idcontainerports", + "description": "Sets an array of ports to expose on the container.", + "type": "array", + "items": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ] + }, + "minItems": 1 + }, + "volumes": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idcontainervolumes", + "description": "Sets an array of volumes for the container to use. You can use volumes to share data between services or other steps in a job. You can specify named Docker volumes, anonymous Docker volumes, or bind mounts on the host.\nTo specify a volume, you specify the source and destination path: :\nThe is a volume name or an absolute path on the host machine, and is an absolute path in the container.", + "type": "array", + "items": { + "type": "string", + "pattern": "^[^:]+:[^:]+$" + }, + "minItems": 1 + }, + "options": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idcontaineroptions", + "description": "Additional Docker container resource options. For a list of options, see https://docs.docker.com/engine/reference/commandline/create/#options.", + "type": "string" + } + }, + "required": ["image"], + "additionalProperties": false + }, + "defaults": { + "type": "object", + "properties": { + "run": { + "type": "object", + "properties": { + "shell": { + "$ref": "#/definitions/shell" + }, + "working-directory": { + "$ref": "#/definitions/working-directory" + } + }, + "minProperties": 1, + "additionalProperties": false + } + }, + "minProperties": 1, + "additionalProperties": false + }, + "permissions": { + "$comment": "https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#permissions", + "description": "You can modify the default permissions granted to the GITHUB_TOKEN, adding or removing access as required, so that you only allow the minimum required access.", + "oneOf": [ + { + "type": "string", + "enum": ["read-all", "write-all"] + }, + { + "$ref": "#/definitions/permissions-event" + } + ] + }, + "permissions-event": { + "type": "object", + "additionalProperties": false, + "properties": { + "actions": { + "$ref": "#/definitions/permissions-level" + }, + "checks": { + "$ref": "#/definitions/permissions-level" + }, + "contents": { + "$ref": "#/definitions/permissions-level" + }, + "deployments": { + "$ref": "#/definitions/permissions-level" + }, + "discussions": { + "$ref": "#/definitions/permissions-level" + }, + "id-token": { + "$ref": "#/definitions/permissions-level" + }, + "issues": { + "$ref": "#/definitions/permissions-level" + }, + "packages": { + "$ref": "#/definitions/permissions-level" + }, + "pages": { + "$ref": "#/definitions/permissions-level" + }, + "pull-requests": { + "$ref": "#/definitions/permissions-level" + }, + "repository-projects": { + "$ref": "#/definitions/permissions-level" + }, + "security-events": { + "$ref": "#/definitions/permissions-level" + }, + "statuses": { + "$ref": "#/definitions/permissions-level" + } + } + }, + "permissions-level": { + "type": "string", + "enum": ["read", "write", "none"] + }, + "env": { + "$comment": "https://docs.github.com/en/actions/learn-github-actions/environment-variables", + "description": "To set custom environment variables, you need to specify the variables in the workflow file. You can define environment variables for a step, job, or entire workflow using the jobs..steps[*].env, jobs..env, and env keywords. For more information, see https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsenv", + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + { + "$ref": "#/definitions/stringContainingExpressionSyntax" + } + ] + }, + "environment": { + "$comment": "https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idenvironment", + "description": "The environment that the job references", + "type": "object", + "properties": { + "name": { + "$comment": "https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#example-using-a-single-environment-name", + "description": "The name of the environment configured in the repo.", + "type": "string" + }, + "url": { + "$comment": "https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#example-using-environment-name-and-url", + "description": "A deployment URL", + "type": "string" + } + }, + "required": ["name"], + "additionalProperties": false + }, + "event": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows", + "type": "string", + "enum": [ + "branch_protection_rule", + "check_run", + "check_suite", + "create", + "delete", + "deployment", + "deployment_status", + "discussion", + "discussion_comment", + "fork", + "gollum", + "issue_comment", + "issues", + "label", + "member", + "milestone", + "page_build", + "project", + "project_card", + "project_column", + "public", + "pull_request", + "pull_request_review", + "pull_request_review_comment", + "pull_request_target", + "push", + "registry_package", + "release", + "status", + "watch", + "workflow_call", + "workflow_dispatch", + "workflow_run", + "repository_dispatch" + ] + }, + "eventObject": { + "oneOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "additionalProperties": true + }, + "expressionSyntax": { + "type": "string", + "$comment": "escape `{` and `}` in pattern to be unicode compatible (#1360)", + "pattern": "^\\$\\{\\{(.|[\r\n])*\\}\\}$" + }, + "stringContainingExpressionSyntax": { + "type": "string", + "$comment": "escape `{` and `}` in pattern to be unicode compatible (#1360)", + "pattern": "^.*\\$\\{\\{(.|[\r\n])*\\}\\}.*$" + }, + "globs": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "minItems": 1 + }, + "machine": { + "type": "string", + "enum": ["linux", "macos", "windows"] + }, + "name": { + "type": "string", + "pattern": "^[_a-zA-Z][a-zA-Z0-9_-]*$" + }, + "path": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpaths", + "$ref": "#/definitions/globs", + "description": "When using the push and pull_request events, you can configure a workflow to run when at least one file does not match paths-ignore or at least one modified file matches the configured paths. Path filters are not evaluated for pushes to tags.\nThe paths-ignore and paths keywords accept glob patterns that use the * and ** wildcard characters to match more than one path name. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet.\nYou can exclude paths using two types of filters. You cannot use both of these filters for the same event in a workflow.\n- paths-ignore - Use the paths-ignore filter when you only need to exclude path names.\n- paths - Use the paths filter when you need to filter paths for positive matches and exclude paths." + }, + "ref": { + "properties": { + "branches": { + "$ref": "#/definitions/branch" + }, + "branches-ignore": { + "$ref": "#/definitions/branch" + }, + "tags": { + "$ref": "#/definitions/branch" + }, + "tags-ignore": { + "$ref": "#/definitions/branch" + }, + "paths": { + "$ref": "#/definitions/path" + }, + "paths-ignore": { + "$ref": "#/definitions/path" + } + }, + "oneOf": [ + { + "type": "object", + "allOf": [ + { + "not": { + "required": ["branches", "branches-ignore"] + } + }, + { + "not": { + "required": ["tags", "tags-ignore"] + } + }, + { + "not": { + "required": ["paths", "paths-ignore"] + } + } + ] + }, + { + "type": "null" + } + ] + }, + "shell": { + "$comment": "https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell", + "description": "You can override the default shell settings in the runner's operating system using the shell keyword. You can use built-in shell keywords, or you can define a custom set of shell options.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#custom-shell", + "enum": ["bash", "pwsh", "python", "sh", "cmd", "powershell"] + } + ] + }, + "types": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#onevent_nametypes", + "description": "Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary.\nYou can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events.", + "type": "array", + "minItems": 1 + }, + "working-directory": { + "$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsrun", + "description": "Using the working-directory keyword, you can specify the working directory of where to run the command.", + "type": "string" + }, + "jobNeeds": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idneeds", + "description": "Identifies any jobs that must complete successfully before this job will run. It can be a string or array of strings. If a job fails, all jobs that need it are skipped unless the jobs use a conditional statement that causes the job to continue.", + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/name" + }, + "minItems": 1 + }, + { + "$ref": "#/definitions/name" + } + ] + }, + "matrix": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix", + "description": "A build matrix is a set of different configurations of the virtual environment. For example you might run a job against more than one supported version of a language, operating system, or tool. Each configuration is a copy of the job that runs and reports a status.\nYou can specify a matrix by supplying an array for the configuration options. For example, if the GitHub virtual environment supports Node.js versions 6, 8, and 10 you could specify an array of those versions in the matrix.\nWhen you define a matrix of operating systems, you must set the required runs-on keyword to the operating system of the current job, rather than hard-coding the operating system name. To access the operating system name, you can use the matrix.os context parameter to set runs-on. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.", + "oneOf": [ + { + "type": "object" + }, + { + "$ref": "#/definitions/expressionSyntax" + } + ], + "patternProperties": { + "^(in|ex)clude$": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#example-including-configurations-in-a-matrix-build", + "oneOf": [ + { + "$ref": "#/definitions/expressionSyntax" + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/configuration" + } + }, + "minItems": 1 + } + ] + } + }, + "additionalProperties": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/configuration" + }, + "minItems": 1 + }, + { + "$ref": "#/definitions/expressionSyntax" + } + ] + }, + "minProperties": 1 + }, + "reusableWorkflowCallJob": { + "$comment": "https://docs.github.com/en/actions/learn-github-actions/reusing-workflows#calling-a-reusable-workflow", + "description": "Each job must have an id to associate with the job. The key job_id is a string and its value is a map of the job's configuration data. You must replace with a string that is unique to the jobs object. The must start with a letter or _ and contain only alphanumeric characters, -, or _.", + "type": "object", + "properties": { + "name": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idname", + "description": "The name of the job displayed on GitHub.", + "type": "string" + }, + "needs": { + "$ref": "#/definitions/jobNeeds" + }, + "permissions": { + "$ref": "#/definitions/permissions" + }, + "if": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idif", + "description": "You can use the if conditional to prevent a job from running unless a condition is met. You can use any supported context and expression to create a conditional.\nExpressions in an if conditional do not require the ${{ }} syntax. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.", + "type": ["boolean", "number", "string"] + }, + "uses": { + "$comment": "https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_iduses", + "description": "The location and version of a reusable workflow file to run as a job, of the form './{path/to}/{localfile}.yml' or '{owner}/{repo}/{path}/{filename}@{ref}'. {ref} can be a SHA, a release tag, or a branch name. Using the commit SHA is the safest for stability and security.", + "type": "string", + "pattern": "^(.+/)+(.+)\\.(ya?ml)(@.+)?$" + }, + "with": { + "$comment": "https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idwith", + "description": "A map of inputs that are passed to the called workflow. Any inputs that you pass must match the input specifications defined in the called workflow. Unlike 'jobs..steps[*].with', the inputs you pass with 'jobs..with' are not be available as environment variables in the called workflow. Instead, you can reference the inputs by using the inputs context.", + "$ref": "#/definitions/env" + }, + "secrets": { + "$comment": "https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idsecrets", + "description": "When a job is used to call a reusable workflow, you can use 'secrets' to provide a map of secrets that are passed to the called workflow. Any secrets that you pass must match the names defined in the called workflow.", + "oneOf": [ + { + "$ref": "#/definitions/env" + }, + { + "type": "string", + "enum": ["inherit"] + } + ] + }, + "strategy": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategy", + "description": "A strategy creates a build matrix for your jobs. You can define different variations of an environment to run each job in.", + "type": "object", + "properties": { + "matrix": { + "$ref": "#/definitions/matrix" + }, + "fail-fast": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast", + "description": "When set to true, GitHub cancels all in-progress jobs if any matrix job fails. Default: true", + "type": ["boolean", "string"], + "default": true + }, + "max-parallel": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategymax-parallel", + "description": "The maximum number of jobs that can run simultaneously when using a matrix job strategy. By default, GitHub will maximize the number of jobs run in parallel depending on the available runners on GitHub-hosted virtual machines.", + "type": ["number", "string"] + } + }, + "required": ["matrix"], + "additionalProperties": false + }, + "concurrency": { + "$comment": "https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idconcurrency", + "description": "Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time. A concurrency group can be any string or expression. The expression can use any context except for the secrets context. \nYou can also specify concurrency at the workflow level. \nWhen a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the repository is in progress, the queued job or workflow will be pending. Any previously pending job or workflow in the concurrency group will be canceled. To also cancel any currently running job or workflow in the same concurrency group, specify cancel-in-progress: true.", + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/concurrency" + } + ] + } + }, + "required": ["uses"], + "additionalProperties": false + }, + "normalJob": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_id", + "description": "Each job must have an id to associate with the job. The key job_id is a string and its value is a map of the job's configuration data. You must replace with a string that is unique to the jobs object. The must start with a letter or _ and contain only alphanumeric characters, -, or _.", + "type": "object", + "properties": { + "name": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idname", + "description": "The name of the job displayed on GitHub.", + "type": "string" + }, + "needs": { + "$ref": "#/definitions/jobNeeds" + }, + "permissions": { + "$ref": "#/definitions/permissions" + }, + "runs-on": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idruns-on", + "description": "The type of machine to run the job on. The machine can be either a GitHub-hosted runner, or a self-hosted runner.", + "anyOf": [ + { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#github-hosted-runners", + "type": "string" + }, + { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#self-hosted-runners", + "type": "array", + "anyOf": [ + { + "items": [ + { + "type": "string" + } + ], + "minItems": 1 + } + ] + }, + { + "$comment": "https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-runners-in-a-group", + "type": "object", + "properties": { + "group": { + "type": "string" + }, + "labels": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + { + "$ref": "#/definitions/stringContainingExpressionSyntax" + }, + { + "$ref": "#/definitions/expressionSyntax" + } + ] + }, + "environment": { + "$comment": "https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idenvironment", + "description": "The environment that the job references.", + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/environment" + } + ] + }, + "outputs": { + "$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjobs_idoutputs", + "description": "A map of outputs for a job. Job outputs are available to all downstream jobs that depend on this job.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "minProperties": 1 + }, + "env": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idenv", + "$ref": "#/definitions/env", + "description": "A map of environment variables that are available to all steps in the job." + }, + "defaults": { + "$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_iddefaults", + "$ref": "#/definitions/defaults", + "description": "A map of default settings that will apply to all steps in the job." + }, + "if": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idif", + "description": "You can use the if conditional to prevent a job from running unless a condition is met. You can use any supported context and expression to create a conditional.\nExpressions in an if conditional do not require the ${{ }} syntax. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.", + "type": ["boolean", "number", "string"] + }, + "steps": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idsteps", + "description": "A job contains a sequence of tasks called steps. Steps can run commands, run setup tasks, or run an action in your repository, a public repository, or an action published in a Docker registry. Not all steps run actions, but all actions run as a step. Each step runs in its own process in the virtual environment and has access to the workspace and filesystem. Because steps run in their own process, changes to environment variables are not preserved between steps. GitHub provides built-in steps to set up and complete a job.\nMust contain either `uses` or `run`\n", + "type": "array", + "items": { + "allOf": [ + { + "oneOf": [ + { + "type": "object", + "properties": { + "uses": { + "type": "string" + } + }, + "required": ["uses"] + }, + { + "type": "object", + "properties": { + "run": { + "type": "string" + } + }, + "required": ["run"] + } + ] + }, + { + "type": "object", + "properties": { + "id": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsid", + "description": "A unique identifier for the step. You can use the id to reference the step in contexts. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.", + "type": "string" + }, + "if": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsif", + "description": "You can use the if conditional to prevent a step from running unless a condition is met. You can use any supported context and expression to create a conditional.\nExpressions in an if conditional do not require the ${{ }} syntax. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.", + "type": ["boolean", "number", "string"] + }, + "name": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsname", + "description": "A name for your step to display on GitHub.", + "type": "string" + }, + "uses": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsuses", + "description": "Selects an action to run as part of a step in your job. An action is a reusable unit of code. You can use an action defined in the same repository as the workflow, a public repository, or in a published Docker container image (https://hub.docker.com/).\nWe strongly recommend that you include the version of the action you are using by specifying a Git ref, SHA, or Docker tag number. If you don't specify a version, it could break your workflows or cause unexpected behavior when the action owner publishes an update.\n- Using the commit SHA of a released action version is the safest for stability and security.\n- Using the specific major action version allows you to receive critical fixes and security patches while still maintaining compatibility. It also assures that your workflow should still work.\n- Using the master branch of an action may be convenient, but if someone releases a new major version with a breaking change, your workflow could break.\nSome actions require inputs that you must set using the with keyword. Review the action's README file to determine the inputs required.\nActions are either JavaScript files or Docker containers. If the action you're using is a Docker container you must run the job in a Linux virtual environment. For more details, see https://help.github.com/en/articles/virtual-environments-for-github-actions.", + "type": "string" + }, + "run": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsrun", + "description": "Runs command-line programs using the operating system's shell. If you do not provide a name, the step name will default to the text specified in the run command.\nCommands run using non-login shells by default. You can choose a different shell and customize the shell used to run commands. For more information, see https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#using-a-specific-shell.\nEach run keyword represents a new process and shell in the virtual environment. When you provide multi-line commands, each line runs in the same shell.", + "type": "string" + }, + "working-directory": { + "$ref": "#/definitions/working-directory" + }, + "shell": { + "$ref": "#/definitions/shell" + }, + "with": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepswith", + "$ref": "#/definitions/env", + "description": "A map of the input parameters defined by the action. Each input parameter is a key/value pair. Input parameters are set as environment variables. The variable is prefixed with INPUT_ and converted to upper case.", + "properties": { + "args": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepswithargs", + "type": "string" + }, + "entrypoint": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepswithentrypoint", + "type": "string" + } + } + }, + "env": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsenv", + "$ref": "#/definitions/env", + "description": "Sets environment variables for steps to use in the virtual environment. You can also set environment variables for the entire workflow or a job." + }, + "continue-on-error": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error", + "description": "Prevents a job from failing when a step fails. Set to true to allow a job to pass when this step fails.", + "oneOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/expressionSyntax" + } + ], + "default": false + }, + "timeout-minutes": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepstimeout-minutes", + "description": "The maximum number of minutes to run the step before killing the process.", + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/expressionSyntax" + } + ] + } + }, + "dependencies": { + "working-directory": ["run"], + "shell": ["run"] + }, + "additionalProperties": false + } + ] + }, + "minItems": 1 + }, + "timeout-minutes": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idtimeout-minutes", + "description": "The maximum number of minutes to let a workflow run before GitHub automatically cancels it. Default: 360", + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/expressionSyntax" + } + ], + "default": 360 + }, + "strategy": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategy", + "description": "A strategy creates a build matrix for your jobs. You can define different variations of an environment to run each job in.", + "type": "object", + "properties": { + "matrix": { + "$ref": "#/definitions/matrix" + }, + "fail-fast": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast", + "description": "When set to true, GitHub cancels all in-progress jobs if any matrix job fails. Default: true", + "type": ["boolean", "string"], + "default": true + }, + "max-parallel": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategymax-parallel", + "description": "The maximum number of jobs that can run simultaneously when using a matrix job strategy. By default, GitHub will maximize the number of jobs run in parallel depending on the available runners on GitHub-hosted virtual machines.", + "type": ["number", "string"] + } + }, + "required": ["matrix"], + "additionalProperties": false + }, + "continue-on-error": { + "$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idcontinue-on-error", + "description": "Prevents a workflow run from failing when a job fails. Set to true to allow a workflow run to pass when this job fails.", + "oneOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/expressionSyntax" + } + ] + }, + "container": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idcontainer", + "description": "A container to run any steps in a job that don't already specify a container. If you have steps that use both script and container actions, the container actions will run as sibling containers on the same network with the same volume mounts.\nIf you do not set a container, all steps will run directly on the host specified by runs-on unless a step refers to an action configured to run in a container.", + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/container" + } + ] + }, + "services": { + "$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idservices", + "description": "Additional containers to host services for a job in a workflow. These are useful for creating databases or cache services like redis. The runner on the virtual machine will automatically create a network and manage the life cycle of the service containers.\nWhen you use a service container for a job or your step uses container actions, you don't need to set port information to access the service. Docker automatically exposes all ports between containers on the same network.\nWhen both the job and the action run in a container, you can directly reference the container by its hostname. The hostname is automatically mapped to the service name.\nWhen a step does not use a container action, you must access the service using localhost and bind the ports.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/container" + } + }, + "concurrency": { + "$comment": "https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idconcurrency", + "description": "Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time. A concurrency group can be any string or expression. The expression can use any context except for the secrets context. \nYou can also specify concurrency at the workflow level. \nWhen a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the repository is in progress, the queued job or workflow will be pending. Any previously pending job or workflow in the concurrency group will be canceled. To also cancel any currently running job or workflow in the same concurrency group, specify cancel-in-progress: true.", + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/concurrency" + } + ] + } + }, + "required": ["runs-on"], + "additionalProperties": false + } + }, + "properties": { + "name": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#name", + "description": "The name of your workflow. GitHub displays the names of your workflows on your repository's actions page. If you omit this field, GitHub sets the name to the workflow's filename.", + "type": "string" + }, + "on": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#on", + "description": "The name of the GitHub event that triggers the workflow. You can provide a single event string, array of events, array of event types, or an event configuration map that schedules a workflow or restricts the execution of a workflow to specific files, tags, or branch changes. For a list of available events, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows.", + "oneOf": [ + { + "$ref": "#/definitions/event" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/event" + }, + "minItems": 1 + }, + { + "type": "object", + "properties": { + "branch_protection_rule": { + "$comment": "https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#branch_protection_rule", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the branch_protection_rule event occurs. More than one activity type triggers this event.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": ["created", "edited", "deleted"] + }, + "default": ["created", "edited", "deleted"] + } + } + }, + "check_run": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#check-run-event-check_run", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the check_run event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/checks/runs.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "created", + "rerequested", + "completed", + "requested_action" + ] + }, + "default": [ + "created", + "rerequested", + "completed", + "requested_action" + ] + } + } + }, + "check_suite": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#check-suite-event-check_suite", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the check_suite event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/checks/suites/.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": ["completed", "requested", "rerequested"] + }, + "default": ["completed", "requested", "rerequested"] + } + } + }, + "create": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#create-event-create", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime someone creates a branch or tag, which triggers the create event. For information about the REST API, see https://developer.github.com/v3/git/refs/#create-a-reference." + }, + "delete": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#delete-event-delete", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime someone deletes a branch or tag, which triggers the delete event. For information about the REST API, see https://developer.github.com/v3/git/refs/#delete-a-reference." + }, + "deployment": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#deployment-event-deployment", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime someone creates a deployment, which triggers the deployment event. Deployments created with a commit SHA may not have a Git ref. For information about the REST API, see https://developer.github.com/v3/repos/deployments/." + }, + "deployment_status": { + "$comment": "https://docs.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime a third party provides a deployment status, which triggers the deployment_status event. Deployments created with a commit SHA may not have a Git ref. For information about the REST API, see https://developer.github.com/v3/repos/deployments/#create-a-deployment-status." + }, + "discussion": { + "$comment": "https://docs.github.com/en/actions/reference/events-that-trigger-workflows#discussion", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the discussion event occurs. More than one activity type triggers this event. For information about the GraphQL API, see https://docs.github.com/en/graphql/guides/using-the-graphql-api-for-discussions", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "created", + "edited", + "deleted", + "transferred", + "pinned", + "unpinned", + "labeled", + "unlabeled", + "locked", + "unlocked", + "category_changed", + "answered", + "unanswered" + ] + }, + "default": [ + "created", + "edited", + "deleted", + "transferred", + "pinned", + "unpinned", + "labeled", + "unlabeled", + "locked", + "unlocked", + "category_changed", + "answered", + "unanswered" + ] + } + } + }, + "discussion_comment": { + "$comment": "https://docs.github.com/en/actions/reference/events-that-trigger-workflows#discussion_comment", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the discussion_comment event occurs. More than one activity type triggers this event. For information about the GraphQL API, see https://docs.github.com/en/graphql/guides/using-the-graphql-api-for-discussions", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": ["created", "edited", "deleted"] + }, + "default": ["created", "edited", "deleted"] + } + } + }, + "fork": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#fork-event-fork", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime when someone forks a repository, which triggers the fork event. For information about the REST API, see https://developer.github.com/v3/repos/forks/#create-a-fork." + }, + "gollum": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#gollum-event-gollum", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow when someone creates or updates a Wiki page, which triggers the gollum event." + }, + "issue_comment": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#issue-comment-event-issue_comment", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the issue_comment event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues/comments/.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": ["created", "edited", "deleted"] + }, + "default": ["created", "edited", "deleted"] + } + } + }, + "issues": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#issues-event-issues", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the issues event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "opened", + "edited", + "deleted", + "transferred", + "pinned", + "unpinned", + "closed", + "reopened", + "assigned", + "unassigned", + "labeled", + "unlabeled", + "locked", + "unlocked", + "milestoned", + "demilestoned" + ] + }, + "default": [ + "opened", + "edited", + "deleted", + "transferred", + "pinned", + "unpinned", + "closed", + "reopened", + "assigned", + "unassigned", + "labeled", + "unlabeled", + "locked", + "unlocked", + "milestoned", + "demilestoned" + ] + } + } + }, + "label": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#label-event-label", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the label event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues/labels/.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": ["created", "edited", "deleted"] + }, + "default": ["created", "edited", "deleted"] + } + } + }, + "member": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#member-event-member", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the member event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/repos/collaborators/.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": ["added", "edited", "deleted"] + }, + "default": ["added", "edited", "deleted"] + } + } + }, + "merge_group": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#merge_group", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow when a pull request is added to a merge queue, which adds the pull request to a merge group. For information about the merge queue, see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/merging-a-pull-request-with-a-merge-queue .", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": ["checks_requested"] + }, + "default": ["checks_requested"] + } + } + }, + "milestone": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#milestone-event-milestone", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the milestone event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/issues/milestones/.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": ["created", "closed", "opened", "edited", "deleted"] + }, + "default": [ + "created", + "closed", + "opened", + "edited", + "deleted" + ] + } + } + }, + "page_build": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#page-build-event-page_build", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime someone pushes to a GitHub Pages-enabled branch, which triggers the page_build event. For information about the REST API, see https://developer.github.com/v3/repos/pages/." + }, + "project": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#project-event-project", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the project event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/projects/.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "created", + "updated", + "closed", + "reopened", + "edited", + "deleted" + ] + }, + "default": [ + "created", + "updated", + "closed", + "reopened", + "edited", + "deleted" + ] + } + } + }, + "project_card": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#project-card-event-project_card", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the project_card event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/projects/cards.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "created", + "moved", + "converted", + "edited", + "deleted" + ] + }, + "default": [ + "created", + "moved", + "converted", + "edited", + "deleted" + ] + } + } + }, + "project_column": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#project-column-event-project_column", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the project_column event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/projects/columns.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": ["created", "updated", "moved", "deleted"] + }, + "default": ["created", "updated", "moved", "deleted"] + } + } + }, + "public": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#public-event-public", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime someone makes a private repository public, which triggers the public event. For information about the REST API, see https://developer.github.com/v3/repos/#edit." + }, + "pull_request": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#pull-request-event-pull_request", + "$ref": "#/definitions/ref", + "description": "Runs your workflow anytime the pull_request event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/pulls.\nNote: Workflows do not run on private base repositories when you open a pull request from a forked repository.\nWhen you create a pull request from a forked repository to the base repository, GitHub sends the pull_request event to the base repository and no pull request events occur on the forked repository.\nWorkflows don't run on forked repositories by default. You must enable GitHub Actions in the Actions tab of the forked repository.\nThe permissions for the GITHUB_TOKEN in forked repositories is read-only. For more information about the GITHUB_TOKEN, see https://help.github.com/en/articles/virtual-environments-for-github-actions.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "assigned", + "unassigned", + "labeled", + "unlabeled", + "opened", + "edited", + "closed", + "reopened", + "synchronize", + "converted_to_draft", + "ready_for_review", + "locked", + "unlocked", + "review_requested", + "review_request_removed", + "auto_merge_enabled", + "auto_merge_disabled" + ] + }, + "default": ["opened", "synchronize", "reopened"] + } + }, + "patternProperties": { + "^(branche|tag|path)s(-ignore)?$": { + "type": "array" + } + }, + "additionalProperties": false + }, + "pull_request_review": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#pull-request-review-event-pull_request_review", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the pull_request_review event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/pulls/reviews.\nNote: Workflows do not run on private base repositories when you open a pull request from a forked repository.\nWhen you create a pull request from a forked repository to the base repository, GitHub sends the pull_request event to the base repository and no pull request events occur on the forked repository.\nWorkflows don't run on forked repositories by default. You must enable GitHub Actions in the Actions tab of the forked repository.\nThe permissions for the GITHUB_TOKEN in forked repositories is read-only. For more information about the GITHUB_TOKEN, see https://help.github.com/en/articles/virtual-environments-for-github-actions.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": ["submitted", "edited", "dismissed"] + }, + "default": ["submitted", "edited", "dismissed"] + } + } + }, + "pull_request_review_comment": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#pull-request-review-comment-event-pull_request_review_comment", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime a comment on a pull request's unified diff is modified, which triggers the pull_request_review_comment event. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/pulls/comments.\nNote: Workflows do not run on private base repositories when you open a pull request from a forked repository.\nWhen you create a pull request from a forked repository to the base repository, GitHub sends the pull_request event to the base repository and no pull request events occur on the forked repository.\nWorkflows don't run on forked repositories by default. You must enable GitHub Actions in the Actions tab of the forked repository.\nThe permissions for the GITHUB_TOKEN in forked repositories is read-only. For more information about the GITHUB_TOKEN, see https://help.github.com/en/articles/virtual-environments-for-github-actions.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": ["created", "edited", "deleted"] + }, + "default": ["created", "edited", "deleted"] + } + } + }, + "pull_request_target": { + "$comment": "https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target", + "$ref": "#/definitions/ref", + "description": "This event is similar to pull_request, except that it runs in the context of the base repository of the pull request, rather than in the merge commit. This means that you can more safely make your secrets available to the workflows triggered by the pull request, because only workflows defined in the commit on the base repository are run. For example, this event allows you to create workflows that label and comment on pull requests, based on the contents of the event payload.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "assigned", + "unassigned", + "labeled", + "unlabeled", + "opened", + "edited", + "closed", + "reopened", + "synchronize", + "converted_to_draft", + "ready_for_review", + "locked", + "unlocked", + "review_requested", + "review_request_removed", + "auto_merge_enabled", + "auto_merge_disabled" + ] + }, + "default": ["opened", "synchronize", "reopened"] + } + }, + "patternProperties": { + "^(branche|tag|path)s(-ignore)?$": {} + }, + "additionalProperties": false + }, + "push": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#push-event-push", + "$ref": "#/definitions/ref", + "description": "Runs your workflow when someone pushes to a repository branch, which triggers the push event.\nNote: The webhook payload available to GitHub Actions does not include the added, removed, and modified attributes in the commit object. You can retrieve the full commit object using the REST API. For more information, see https://developer.github.com/v3/repos/commits/#get-a-single-commit.", + "patternProperties": { + "^(branche|tag|path)s(-ignore)?$": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false + }, + "registry_package": { + "$comment": "https://help.github.com/en/actions/reference/events-that-trigger-workflows#registry-package-event-registry_package", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime a package is published or updated. For more information, see https://help.github.com/en/github/managing-packages-with-github-packages.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": ["published", "updated"] + }, + "default": ["published", "updated"] + } + } + }, + "release": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#release-event-release", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the release event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/repos/releases/ in the GitHub Developer documentation.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": [ + "published", + "unpublished", + "created", + "edited", + "deleted", + "prereleased", + "released" + ] + }, + "default": [ + "published", + "unpublished", + "created", + "edited", + "deleted", + "prereleased", + "released" + ] + } + } + }, + "status": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#status-event-status", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the status of a Git commit changes, which triggers the status event. For information about the REST API, see https://developer.github.com/v3/repos/statuses/." + }, + "watch": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#watch-event-watch", + "$ref": "#/definitions/eventObject", + "description": "Runs your workflow anytime the watch event occurs. More than one activity type triggers this event. For information about the REST API, see https://developer.github.com/v3/activity/starring/." + }, + "workflow_call": { + "$comment": "https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#workflow_call", + "description": "Allows workflows to be reused by other workflows.", + "properties": { + "inputs": { + "$comment": "https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onworkflow_callinputs", + "description": "When using the workflow_call keyword, you can optionally specify inputs that are passed to the called workflow from the caller workflow.", + "type": "object", + "patternProperties": { + "^[_a-zA-Z][a-zA-Z0-9_-]*$": { + "$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputsinput_id", + "description": "A string identifier to associate with the input. The value of is a map of the input's metadata. The must be a unique identifier within the inputs object. The must start with a letter or _ and contain only alphanumeric characters, -, or _.", + "type": "object", + "properties": { + "description": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_iddescription", + "description": "A string description of the input parameter.", + "type": "string" + }, + "deprecationMessage": { + "description": "A string shown to users using the deprecated input.", + "type": "string" + }, + "required": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_idrequired", + "description": "A boolean to indicate whether the action requires the input parameter. Set to true when the parameter is required.", + "type": "boolean" + }, + "type": { + "$comment": "https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onworkflow_callinput_idtype", + "description": "Required if input is defined for the on.workflow_call keyword. The value of this parameter is a string specifying the data type of the input. This must be one of: boolean, number, or string.", + "type": "string", + "enum": ["boolean", "number", "string"] + }, + "default": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_iddefault", + "description": "The default value is used when an input parameter isn't specified in a workflow file.", + "type": ["boolean", "number", "string"] + } + }, + "required": ["type"], + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "secrets": { + "$comment": "https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onworkflow_callsecrets", + "description": "A map of the secrets that can be used in the called workflow. Within the called workflow, you can use the secrets context to refer to a secret.", + "patternProperties": { + "^[_a-zA-Z][a-zA-Z0-9_-]*$": { + "$comment": "https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onworkflow_callsecretssecret_id", + "description": "A string identifier to associate with the secret.", + "properties": { + "description": { + "description": "A string description of the secret parameter.", + "type": "string" + }, + "required": { + "$comment": "https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onworkflow_callsecretssecret_idrequired", + "description": "A boolean specifying whether the secret must be supplied.", + "type": "boolean" + } + }, + "required": ["required"], + "additionalProperties": false + } + }, + "additionalProperties": false + } + } + }, + "workflow_dispatch": { + "$comment": "https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/", + "description": "You can now create workflows that are manually triggered with the new workflow_dispatch event. You will then see a 'Run workflow' button on the Actions tab, enabling you to easily trigger a run.", + "properties": { + "inputs": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputs", + "description": "Input parameters allow you to specify data that the action expects to use during runtime. GitHub stores input parameters as environment variables. Input ids with uppercase letters are converted to lowercase during runtime. We recommended using lowercase input ids.", + "type": "object", + "patternProperties": { + "^[_a-zA-Z][a-zA-Z0-9_-]*$": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_id", + "description": "A string identifier to associate with the input. The value of is a map of the input's metadata. The must be a unique identifier within the inputs object. The must start with a letter or _ and contain only alphanumeric characters, -, or _.", + "type": "object", + "properties": { + "description": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_iddescription", + "description": "A string description of the input parameter.", + "type": "string" + }, + "deprecationMessage": { + "description": "A string shown to users using the deprecated input.", + "type": "string" + }, + "required": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_idrequired", + "description": "A boolean to indicate whether the action requires the input parameter. Set to true when the parameter is required.", + "type": "boolean" + }, + "default": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_iddefault", + "description": "A string representing the default value. The default value is used when an input parameter isn't specified in a workflow file." + }, + "type": { + "description": "A string representing the type of the input.", + "$comment": "https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_dispatchinputsinput_idtype", + "type": "string", + "enum": [ + "string", + "choice", + "boolean", + "number", + "environment" + ] + }, + "options": { + "$comment": "https://github.blog/changelog/2021-11-10-github-actions-input-types-for-manual-workflows", + "description": "The options of the dropdown list, if the type is a choice.", + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "string" + } + }, + "required": ["type"] + }, + "then": { + "properties": { + "default": { + "type": "string" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "boolean" + } + }, + "required": ["type"] + }, + "then": { + "properties": { + "default": { + "type": "boolean" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "number" + } + }, + "required": ["type"] + }, + "then": { + "properties": { + "default": { + "type": "number" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "environment" + } + }, + "required": ["type"] + }, + "then": { + "properties": { + "default": { + "type": "string" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "choice" + } + }, + "required": ["type"] + }, + "then": { + "required": ["options"] + } + } + ], + "required": ["description"], + "additionalProperties": false + } + }, + "additionalProperties": false + } + } + }, + "workflow_run": { + "$comment": "https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_run", + "$ref": "#/definitions/eventObject", + "description": "This event occurs when a workflow run is requested or completed, and allows you to execute a workflow based on the finished result of another workflow. For example, if your pull_request workflow generates build artifacts, you can create a new workflow that uses workflow_run to analyze the results and add a comment to the original pull request.", + "properties": { + "types": { + "$ref": "#/definitions/types", + "items": { + "type": "string", + "enum": ["requested", "completed"] + }, + "default": ["requested", "completed"] + }, + "workflows": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + } + }, + "patternProperties": { + "^branches(-ignore)?$": {} + } + }, + "repository_dispatch": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#external-events-repository_dispatch", + "$ref": "#/definitions/eventObject", + "description": "You can use the GitHub API to trigger a webhook event called repository_dispatch when you want to trigger a workflow for activity that happens outside of GitHub. For more information, see https://developer.github.com/v3/repos/#create-a-repository-dispatch-event.\nTo trigger the custom repository_dispatch webhook event, you must send a POST request to a GitHub API endpoint and provide an event_type name to describe the activity type. To trigger a workflow run, you must also configure your workflow to use the repository_dispatch event." + }, + "schedule": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows#scheduled-events-schedule", + "description": "You can schedule a workflow to run at specific UTC times using POSIX cron syntax (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07). Scheduled workflows run on the latest commit on the default or base branch. The shortest interval you can run scheduled workflows is once every 5 minutes.\nNote: GitHub Actions does not support the non-standard syntax @yearly, @monthly, @weekly, @daily, @hourly, and @reboot.\nYou can use crontab guru (https://crontab.guru/). to help generate your cron syntax and confirm what time it will run. To help you get started, there is also a list of crontab guru examples (https://crontab.guru/examples.html).", + "type": "array", + "items": { + "properties": { + "cron": { + "$comment": "https://stackoverflow.com/a/57639657/4044345", + "type": "string", + "pattern": "^(((\\d+,)+\\d+|((\\d+|\\*)/\\d+|((JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)(-(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))?))|(\\d+-\\d+)|\\d+(-\\d+)?/\\d+(-\\d+)?|\\d+|\\*|(MON|TUE|WED|THU|FRI|SAT|SUN)(-(MON|TUE|WED|THU|FRI|SAT|SUN))?) ?){5}$" + } + }, + "additionalProperties": false + }, + "minItems": 1 + } + }, + "additionalProperties": false + } + ] + }, + "env": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#env", + "$ref": "#/definitions/env", + "description": "A map of environment variables that are available to all jobs and steps in the workflow." + }, + "defaults": { + "$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#defaults", + "$ref": "#/definitions/defaults", + "description": "A map of default settings that will apply to all jobs in the workflow." + }, + "concurrency": { + "$comment": "https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency", + "description": "Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time. A concurrency group can be any string or expression. The expression can use any context except for the secrets context. \nYou can also specify concurrency at the workflow level. \nWhen a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the repository is in progress, the queued job or workflow will be pending. Any previously pending job or workflow in the concurrency group will be canceled. To also cancel any currently running job or workflow in the same concurrency group, specify cancel-in-progress: true.", + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/concurrency" + } + ] + }, + "jobs": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobs", + "description": "A workflow run is made up of one or more jobs. Jobs run in parallel by default. To run jobs sequentially, you can define dependencies on other jobs using the jobs..needs keyword.\nEach job runs in a fresh instance of the virtual environment specified by runs-on.\nYou can run an unlimited number of jobs as long as you are within the workflow usage limits. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#usage-limits.", + "type": "object", + "patternProperties": { + "^[_a-zA-Z][a-zA-Z0-9_-]*$": { + "oneOf": [ + { + "$ref": "#/definitions/normalJob" + }, + { + "$ref": "#/definitions/reusableWorkflowCallJob" + } + ] + } + }, + "minProperties": 1, + "additionalProperties": false + }, + "run-name": { + "$comment": "https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#run-name", + "description": "The name for workflow runs generated from the workflow. GitHub displays the workflow run name in the list of workflow runs on your repository's 'Actions' tab.", + "type": "string" + }, + "permissions": { + "$ref": "#/definitions/permissions" + } + }, + "required": ["on", "jobs"], + "type": "object" +} diff --git a/src/test/java/com/github/yunabraska/githubworkflow/services/ActionVersionServiceTest.java b/src/test/java/com/github/yunabraska/githubworkflow/services/ActionVersionServiceTest.java new file mode 100644 index 0000000..d586eab --- /dev/null +++ b/src/test/java/com/github/yunabraska/githubworkflow/services/ActionVersionServiceTest.java @@ -0,0 +1,32 @@ +package com.github.yunabraska.githubworkflow.services; + +import com.intellij.openapi.project.Project; +import com.intellij.testFramework.fixtures.BasePlatformTestCase; +import org.junit.Before; +import org.junit.Test; + +public class ActionVersionServiceTest extends BasePlatformTestCase { + ActionVersionService actionVersionService; + + @Before + public void setUp() throws Exception { + super.setUp(); + var token = System.getenv("GITHUB_TOKEN"); + assertNotNull(token); + + Project project = getProject(); + actionVersionService = new ActionVersionService(project, token); + } + + @Test + public void testGetLatestActionVersion() { + final String latestVersion = actionVersionService.getLatestActionVersion("actions/setup-java"); + assertEquals("v4.0.0", latestVersion); + } + + @Test + public void testIsVersionOutdated() { + assertTrue(actionVersionService.isActionOutdated("actions/setup-java", "v3.0.0")); + assertFalse(actionVersionService.isActionOutdated("actions/setup-java", "v4.5.2")); + } +} diff --git a/src/test/java/com/github/yunabraska/githubworkflow/services/DownloadSchemasTest.java b/src/test/java/com/github/yunabraska/githubworkflow/services/DownloadSchemasTest.java index efe2aac..40d0d71 100644 --- a/src/test/java/com/github/yunabraska/githubworkflow/services/DownloadSchemasTest.java +++ b/src/test/java/com/github/yunabraska/githubworkflow/services/DownloadSchemasTest.java @@ -6,16 +6,16 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardOpenOption; -import java.util.Arrays; import java.util.List; import static com.github.yunabraska.githubworkflow.helper.FileDownloader.downloadSync; +import static junit.framework.TestCase.assertNotNull; public class DownloadSchemasTest { @Test public void downloadSchemas() throws IOException { - final List schemaNames = Arrays.asList( + final List schemaNames = List.of( "dependabot-2.0", "github-action", "github-funding", @@ -32,8 +32,15 @@ public void downloadSchemas() throws IOException { } for (final String schemaName : schemaNames) { - final String schemaContent = downloadSync("https://json.schemastore.org/" + schemaName, "JetBrains GithubWorkflow"); - Files.writeString(Path.of(directory.toFile().getAbsolutePath(), schemaName + ".json"), schemaContent, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); + final String schemaContent = downloadSync( + "https://json.schemastore.org/" + schemaName, "JetBrains GithubWorkflow"); + assertNotNull(schemaContent); + Files.writeString( + Path.of(directory.toFile().getAbsolutePath(), schemaName + ".json"), + schemaContent, + StandardOpenOption.CREATE, + StandardOpenOption.TRUNCATE_EXISTING + ); System.out.println("Saved " + schemaName); System.out.println("Failed to fetch " + schemaName); } diff --git a/src/test/java/com/github/yunabraska/githubworkflow/services/GitHubActionCacheTest.java b/src/test/java/com/github/yunabraska/githubworkflow/services/GitHubActionCacheTest.java index 5a733be..0ca66d3 100644 --- a/src/test/java/com/github/yunabraska/githubworkflow/services/GitHubActionCacheTest.java +++ b/src/test/java/com/github/yunabraska/githubworkflow/services/GitHubActionCacheTest.java @@ -10,6 +10,18 @@ public class GitHubActionCacheTest extends BasePlatformTestCase { + private static void validateResolvedJavaAction(final GitHubAction javaAction) { + assertThat(javaAction.getInputs()).isNotEmpty(); + assertThat(javaAction.getOutputs()).isNotEmpty(); + assertThat(javaAction.isLocal()).isFalse(); + assertThat(javaAction.isAction()).isTrue(); + assertThat(javaAction.isResolved()).isTrue(); + assertThat(javaAction.githubUrl()).isNotNull(); + assertThat(javaAction.name()).isEqualTo("actions/setup-java"); + assertThat(javaAction.downloadUrl()).isEqualTo("https://raw.githubusercontent.com/actions/setup-java/main/action.yml"); + assertThat(javaAction.expiryTime()).isGreaterThan(System.currentTimeMillis()); + } + @Test public void testSerializationAndDeserialization() throws InterruptedException { // GIVEN @@ -21,7 +33,10 @@ public void testSerializationAndDeserialization() throws InterruptedException { // THEN EXPECT validateResolvedJavaAction(javaAction); - assertThat(javaAction.expiryTime()).isEqualTo(getActionCache().get(project, "actions/setup-java@main").expiryTime()); + assertThat(javaAction.expiryTime()) + .isEqualTo(getActionCache() + .get(project, "actions/setup-java@main") + .expiryTime()); // WHEN SERIALIZATION Thread.sleep(25); @@ -49,16 +64,4 @@ public void testSerializationAndDeserialization() throws InterruptedException { validateResolvedJavaAction(reloadedAction); assertThat(reloadedAction.expiryTime()).isNotEqualTo(javaAction.expiryTime()); } - - private static void validateResolvedJavaAction(final GitHubAction javaAction) { - assertThat(javaAction.getInputs()).isNotEmpty(); - assertThat(javaAction.getOutputs()).isNotEmpty(); - assertThat(javaAction.isLocal()).isFalse(); - assertThat(javaAction.isAction()).isTrue(); - assertThat(javaAction.isResolved()).isTrue(); - assertThat(javaAction.githubUrl()).isNotNull(); - assertThat(javaAction.name()).isEqualTo("actions/setup-java"); - assertThat(javaAction.downloadUrl()).isEqualTo("https://raw.githubusercontent.com/actions/setup-java/main/action.yml"); - assertThat(javaAction.expiryTime()).isGreaterThan(System.currentTimeMillis()); - } } diff --git a/src/test/resources/testdata/.github/show_case.yml b/src/test/resources/testdata/.github/show_case.yml index b44968e..739d5ad 100644 --- a/src/test/resources/testdata/.github/show_case.yml +++ b/src/test/resources/testdata/.github/show_case.yml @@ -82,7 +82,7 @@ jobs: step_env_1: "My Step Env 1" step_env_2: "My Step Env 2" my_job_3: - needs: [ my_job_1, my_job_2, my_job_3 ] + needs: [ my_job_1, my_job_2, my_job_3 ] runs-on: ubuntu-latest env: job_env_1: "My Job Env 1"