Example of multiple stats repos in same workflow action
See original GitHub issueFirst of, thanks for an awesome project. Exactly what I needed.
I wanted to share a trick to easily collect stats from multiple repositories in a single workflow. The basic trick is to use a matrix strategy over the stats projects. To make sure that there are no commit conflicts, I’ve set the max-parallel
property to 1:
name: update-stats
concurrency: 'update-stats'
on:
schedule:
# Run this once per day, 10 minutes before the end of the day for keeping the most
# recent data point most meaningful (hours are interpreted in UTC).
- cron: 50 23 * * *
workflow_dispatch: # Allow for running this manually.
jobs:
update-stats:
runs-on: ubuntu-latest
strategy:
matrix:
statsRepo: ['bob/nice-project', 'alice/also-nice-project']
fail-fast: false
max-parallel: 1
steps:
- name: run-ghrs
uses: jgehrcke/github-repo-stats@v1.1.0
with:
# Define the stats repository (the repo to fetch
# stats for and to generate the report for).
# Remove the parameter when the stats repository
# and the data repository are the same.
repository: ${{ matrix.statsRepo }}
# Set a GitHub API token that can read the stats
# repository, and that can push to the data
# repository (which this workflow file lives in),
# to store data and the report files.
ghtoken: ${{ secrets.GHRS_GITHUB_API_TOKEN }}
# Data branch: Branch to push data to (in the data repo).
databranch: main
Thanks again!
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Complex multi-repo builds with GitHub Actions and Camunda ...
Communicating a GitHub Workflow outcome to Camunda Cloud; GitHub Matrix builds; Multiple causes for an action; Specialising HTTP Worker payloads ...
Read more >Marketplace Actions github-repo-stats
This can be used for efficiently tracking multiple stats repositories from within the same data repository. Example workflow file:.
Read more >GitHub Actions — How To Share Data Between Jobs
GitHub provides you an Action called: actions/cache (GitHub Repo), We can use it to upload cache and then download it in different jobs(Docs)....
Read more >How to run multiple GitHub Actions workflows from sub ...
You can't run workflows from subdirectories: You must store workflow files in the .github/workflows directory of your repository.
Read more >Multiple repositories Pull Request chaos, crawl them all in one ...
Thus, in order to use these actions on your organization, you only have to add two Github workflows (one per action) on your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ill update my initial comment just to avoid folks getting this wrong. I see I actually changed it myself to 50.
@egil probably copied that mistake from ‘my’ erroneous README 😃 here’s where I had patched that:
https://github.com/jgehrcke/github-repo-stats/commit/2faf67a34809785a93c0d89f0bbcda837ca9ea08 and https://github.com/jgehrcke/ghrs-test/commit/9b060705bdddb2b31953c0f8dcf4a5cd80fd75ab
original report was here: https://github.com/jgehrcke/github-repo-stats/issues/20