External Sync #20916
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: External Sync | |
on: | |
schedule: | |
# This is mostly a no-op which is why it runs so often | |
- cron: '*/15 * * * *' | |
workflow_dispatch: | |
jobs: | |
external-sync: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Git user | |
run: | | |
set -eux | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11.0" | |
- name: Upgrade pip | |
run: python -m pip install -U pip | |
- name: Install dependencies | |
run: python -m pip install -r scripts/requirements.txt | |
- name: Sync data from external sources | |
run: ./ci/externalsync.sh | |
- name: Check for early exit | |
run: | | |
set -eux | |
if [[ `git rev-list --count HEAD ^main` == 0 ]]; then | |
exit 0 | |
fi | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.PAT_TOKEN }} | |
branch: ${{ github.ref }} |