question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Example of multiple stats repos in same workflow action

See original GitHub issue

First 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:closed
  • Created 2 years ago
  • Reactions:7
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
egilcommented, Sep 7, 2021

Ill update my initial comment just to avoid folks getting this wrong. I see I actually changed it myself to 50.

1reaction
jgehrckecommented, Sep 7, 2021
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found