MergeStat Data Sync #504
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: MergeStat Data Sync | |
on: | |
schedule: | |
- cron: '0 0 * * *' # at midnight (utc) every day | |
jobs: | |
build: | |
name: Run MergeStat | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout MergeStat repo | |
uses: actions/checkout@v2 | |
with: | |
repository: mergestat/mergestat | |
token: ${{ secrets.GITHUB_TOKEN }} | |
submodules: recursive | |
- name: Install libgit2 | |
run: make libgit2 | |
- name: Build MergeStat | |
run: | | |
make | |
cp .build/mergestat /usr/local/bin/mergestat | |
- name: Sync tables | |
run: | | |
export PGSYNC=1 | |
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} | |
export GITHUB_PER_PAGE=15 | |
export POSTGRES_CONNECTION=${{ secrets.POSTGRES_CONNECTION }} | |
mergestat pgsync -v pull_requests "SELECT * FROM github_repo_prs('OpenBB-finance/OpenBBTerminal')" | |
mergestat pgsync -v issues "SELECT * FROM github_repo_issues('OpenBB-finance/OpenBBTerminal')" | |
mergestat pgsync -v repos "SELECT * FROM github_org_repos('OpenBBTerminal')" | |
mergestat pgsync -v commit_stats "SELECT * FROM commits('https://github.com/OpenBB-finance/OpenBBTerminal'), stats('https://github.com/OpenBB-finance/OpenBBTerminal', commits.hash)" | |
mergestat pgsync -v stargazers "SELECT * FROM github_stargazers('OpenBB-finance/OpenBBTerminal')" |