Skip to content

Commit

Permalink
Get the list of primary languages in every repository of the organisa…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
MGaetan89 committed Feb 21, 2024
1 parent 7d1684e commit 6d2e2c8
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/tech_radar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Update Tech Radar

on:
push:
schedule:
- cron: '0 0 * * *'

jobs:
update_tech_radar:
runs-on: ubuntu-latest
name: Update Tech Radar
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install gomplate
run: npm install -g gomplate

- name: Get the list of repositories
id: repository_list
env:
GH_TOKEN: ${{ github.token }}
run: >
echo repository_list_json=$(
gh repo list ${{ github.repository_owner }}
--limit 1000
--source
--no-archived
--visibility public
--json name,primaryLanguage,url
--jq '. | tostring'
) >> $GITHUB_OUTPUT
- name: Update the list of used languages
run: >
echo ${{ toJSON(steps.repository_list.outputs.repository_list_json) }}
| jq '. | reduce .[] as { $name, $primaryLanguage, $url } ( {}; .[ $primaryLanguage.name | tostring ] += [ { name: $name, url: $url } ] )'
| gomplate -d repositories=stdin:///in.json -f techRadar/used_languages.tmpl -o public/techRadar/used_languages.md
- name: Commit the list of changes
run: |
if [ `git ls-files -m | wc -l` -gt 0 ]; then
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add public/techRadar/used_languages.md
git commit -m "Update techRadar/used_languages.md"
git push
fi
4 changes: 4 additions & 0 deletions public/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@
* [Understanding Licenses](/guides/LICENSE_GUIDE.md)
* [Contributor's Handbook](/guides/CONTRIBUTING_GUIDE.md)
* [Code of Conduct Guidelines](/guides/CODE_OF_CONDUCT_GUIDE.md)

**Tech Radar**

* [Used languages](/techRadar/used_languages.md)
Empty file.
9 changes: 9 additions & 0 deletions techRadar/used_languages.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Used languages

{{ range $language, $repositories := (ds "repositories") -}}
## {{ $language }}

{{ range $repository := $repositories -}}
- [{{ $repository.name }}]({{ $repository.url }})
{{ end -}}
{{ end -}}

0 comments on commit 6d2e2c8

Please sign in to comment.