Fetch CodeRabbit Data #29
This file contains hidden or 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: Fetch CodeRabbit Data | |
| on: | |
| schedule: | |
| # Target IST: 12:15 AM and 12:30 PM on weekdays (GitHub cron is UTC). | |
| # 12:15 AM IST = 18:45 UTC prior calendar day → Mon–Fri 18:45 UTC ≈ Tue–Sat 00:15 IST. | |
| # 12:30 PM IST = 07:00 UTC → Mon–Fri 07:00 UTC = Mon–Fri 12:30 IST. | |
| # Staggered from osde2e workflow (*/6 hours) to reduce push conflicts. | |
| - cron: '45 18 * * 1-5' | |
| - cron: '0 7 * * 1-5' | |
| workflow_dispatch: # Allow manual trigger | |
| jobs: | |
| fetch-data: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Fetch CodeRabbit OpenShift data | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| python3 scripts/fetch_coderabbit_Openshift_data.py | |
| - name: Fetch CodeRabbit EEE data | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| python3 scripts/fetch_coderabbit_EEE_data.py | |
| - name: Check for changes | |
| id: git-check | |
| run: | | |
| git diff --exit-code data/coderabbit-openshift-status.json data/coderabbit-EEE-status.json || echo "changed=true" >> $GITHUB_OUTPUT | |
| - name: Commit and push if changed | |
| if: steps.git-check.outputs.changed == 'true' | |
| run: | | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git add data/coderabbit-openshift-status.json data/coderabbit-EEE-status.json | |
| git commit -m "Update CodeRabbit adoption data [skip ci]" | |
| git pull --rebase origin main | |
| git push |