Skip to content
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
14 changes: 13 additions & 1 deletion .github/workflows/codeql-guard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,19 @@ jobs:
if [ "${repo}" = "evalops/.github" ] && [ "${path}" = ".github/workflows/codeql-guard.yml" ]; then
continue
fi
hits+=("${repo}"$'\t'"${path}")
if ! content="$(
GH_TOKEN="${ORG_CODE_SEARCH_TOKEN}" gh api "repos/${repo}/contents/${path}" --jq '.content' |
base64 --decode
)"; then
echo "::warning::Could not verify ${repo}:${path}; preserving search hit."
hits+=("${repo}"$'\t'"${path}")
continue
fi
if grep -Eq '^[[:space:]]*(-[[:space:]]*)?uses:[[:space:]]*github/codeql-action([/@]|[[:space:]]|$)' <<< "${content}"; then
hits+=("${repo}"$'\t'"${path}")
else
echo "::notice::Skipping stale or non-use search hit ${repo}:${path}"
fi
done <<< "${response}"
if [ "${#hits[@]}" -eq 0 ]; then
echo "ok: no CodeQL workflow files found in any evalops repo"
Expand Down
Loading