From f4809d00d8ef56c2b8f7718dc0b2ca06bb65b7ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Thu, 22 Feb 2024 14:55:26 +0100 Subject: [PATCH] Prepare the "Used dependencies" page --- .github/workflows/tech_radar.yml | 13 ++++++++++++- public/_sidebar.md | 1 + public/techRadar/used_dependencies.md | 0 techRadar/used_dependencies.tmpl | 5 +++++ 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 public/techRadar/used_dependencies.md create mode 100644 techRadar/used_dependencies.tmpl diff --git a/.github/workflows/tech_radar.yml b/.github/workflows/tech_radar.yml index b6e0ce0..bcdff44 100644 --- a/.github/workflows/tech_radar.yml +++ b/.github/workflows/tech_radar.yml @@ -27,7 +27,7 @@ jobs: --source --no-archived --visibility public - --json name,primaryLanguage,url + --json name,nameWithOwner,primaryLanguage,url --jq '. | tostring' ) >> $GITHUB_OUTPUT @@ -37,6 +37,17 @@ jobs: | jq '. | reduce .[] as { $name, $primaryLanguage, $url } ( {}; .[ $primaryLanguage.name | tostring ][$name] = $url )' | gomplate -d repositories=stdin:///in.json -f techRadar/used_languages.tmpl -o public/techRadar/used_languages.md + - name: Update the list of used dependencies + env: + GH_TOKEN: ${{ github.token }} + run: | + gh api \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + /repos/SRGSSR/pillarbox-android/dependency-graph/sbom \ + --jq '[ .sbom.packages[] | { name: .name, version: .versionInfo } ]' \ + | gomplate -d dependencies=stdin:///in.json -f techRadar/used_dependencies.tmpl -o public/techRadar/used_dependencies.md + - name: Commit the list of changes run: | if [ `git ls-files -m | wc -l` -gt 0 ]; then diff --git a/public/_sidebar.md b/public/_sidebar.md index 597d92d..8306ad5 100644 --- a/public/_sidebar.md +++ b/public/_sidebar.md @@ -12,3 +12,4 @@ **Tech Radar** * [Used languages](/techRadar/used_languages.md) +* [Used dependencies](/techRadar/used_dependencies.md) diff --git a/public/techRadar/used_dependencies.md b/public/techRadar/used_dependencies.md new file mode 100644 index 0000000..e69de29 diff --git a/techRadar/used_dependencies.tmpl b/techRadar/used_dependencies.tmpl new file mode 100644 index 0000000..9bfc413 --- /dev/null +++ b/techRadar/used_dependencies.tmpl @@ -0,0 +1,5 @@ +# Used dependencies + +{{ range $dependency := (ds "dependencies") -}} +- {{ $dependency.name }} v{{ $dependency.version}} +{{ end -}}