Skip to content

chore: update global workflows #26

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 15, 2025
Merged
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
29 changes: 19 additions & 10 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,32 +51,41 @@ jobs:
"include": []
}

// Track languages we've already added to avoid duplicates
const addedLanguages = new Set()

for (let [key, value] of Object.entries(response.data)) {
// remap language
if (remap_languages[key.toLowerCase()]) {
console.log(`Remapping language: ${key} to ${remap_languages[key.toLowerCase()]}`)
key = remap_languages[key.toLowerCase()]
}
if (supported_languages.includes(key.toLowerCase())) {
console.log(`Found supported language: ${key}`)

const normalizedKey = key.toLowerCase()

if (supported_languages.includes(normalizedKey) && !addedLanguages.has(normalizedKey)) {
// Mark this language as added
addedLanguages.add(normalizedKey)

console.log(`Found supported language: ${normalizedKey}`)
let osList = ['ubuntu-latest'];
if (key.toLowerCase() === 'swift') {
if (normalizedKey === 'swift') {
osList = ['macos-latest'];
} else if (key.toLowerCase() === 'cpp') {
} else if (normalizedKey === 'cpp') {
// TODO: update macos to latest after the below issue is resolved
// https://github.com/github/codeql-action/issues/2266
osList = ['macos-13', 'ubuntu-latest', 'windows-latest'];
}
for (let os of osList) {
// set name for matrix
if (osList.length == 1) {
name = key.toLowerCase()
} else {
name = `${key.toLowerCase()}, ${os}`
}
let name = osList.length === 1 ? normalizedKey : `${normalizedKey}, ${os}`

// add to matrix
matrix['include'].push({"language": key.toLowerCase(), "os": os, "name": name})
matrix['include'].push({
"language": normalizedKey,
"os": os,
"name": name
})
}
}
}
Expand Down