Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
matrix:
language:
- actions
- javascript-typescript
- python
- ruby

steps:
Expand Down
12 changes: 9 additions & 3 deletions test/scripts/codeql_workflow_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ def test_codeql_job_names_match_required_status_checks
languages = job.fetch("strategy").fetch("matrix").fetch("language")
check_names = languages.map { job.fetch("name").sub("${{ matrix.language }}", _1) }

assert_equal(["CodeQL (actions)", "CodeQL (ruby)"], check_names)
assert_equal(
["CodeQL (actions)", "CodeQL (javascript-typescript)", "CodeQL (python)", "CodeQL (ruby)"],
check_names
)
end

def test_codeql_actions_use_the_same_pinned_release
Expand All @@ -39,12 +42,15 @@ def test_dependabot_groups_every_codeql_sub_action
end
end

def test_codeql_has_stable_required_checks_for_actions_and_ruby
def test_codeql_covers_all_maintained_languages_on_pull_requests_and_merge_groups
workflow = YAML.safe_load_file(WORKFLOW)
analyze = workflow.fetch("jobs").fetch("analyze")

assert_equal("CodeQL (${{ matrix.language }})", analyze.fetch("name"))
assert_equal(%w[actions ruby], analyze.fetch("strategy").fetch("matrix").fetch("language"))
assert_equal(
%w[actions javascript-typescript python ruby],
analyze.fetch("strategy").fetch("matrix").fetch("language")
)
assert_includes(workflow.fetch(true), "pull_request")
assert_includes(workflow.fetch(true), "merge_group")
end
Expand Down
Loading