Reduce the number of repositories to fetch #39
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 800 | |
--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] = $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 |