Skip to content

Commit

Permalink
Refactor workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
MGaetan89 committed Feb 28, 2024
1 parent e0dcbec commit f03e70f
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/tech_radar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,12 @@ jobs:
# Load all the dependencies data
for name in $repository_names; do
# Get the list of dependencies by package manager
echo -e "Extracting the dependencies of $name"
dependencies=$(
gh api --verbose \
-H 'Accept: application/vnd.github+json' \
-H 'X-GitHub-Api-Version: 2022-11-28' \
/repos/$name/dependency-graph/sbom \
--jq '[ .sbom.packages.[] | { name: .name | sub("[a-zA-Z.]+[:/](?<package>.*)"; "\(.package)"), packageManager: .name | capture("(?<packageManager>[a-zA-Z.]+)[:/]").packageManager, version: .versionInfo } ] | reduce .[] as { $name, $packageManager, $version } ( {}; .[ $packageManager ] += [ $name + " v" + $version ] )' \
2>/dev/null
)
echo -e "Extracting the dependencies of $name."
dependencies=$(gh api /repos/SRGSSR/pillarbox-android/dependency-graph/sbom 2>/dev/null)
if [ $? -ne 0 ]; then
echo -e "$name doesn't have Dependency Graph enabled"
echo -e "$name doesn't have Dependency Graph enabled."
echo $name >> .packageManagers/unknown
continue
fi
Expand Down

0 comments on commit f03e70f

Please sign in to comment.