Skip to content

Commit

Permalink
Update sync-notebooks.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
edeno committed Feb 7, 2024
1 parent f9ff2af commit c30ddcb
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/sync-notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,28 @@ jobs:
uses: actions/checkout@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0 # Fetch all history for all branches and tags

- name: Install rsync
run: sudo apt-get install rsync

- name: Rsync notebooks
run: |
git clone https://github.com/LorenFrankLab/spyglass.git tmp --depth=1
rsync -av --exclude='.git/' tmp/notebooks/ ./notebooks/
- name: Configure git
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
- name: Commit changes
run: |
git add notebooks/
git commit -m "Sync notebooks" || echo "No changes to commit"
git push origin HEAD:main
git diff --staged --quiet || git commit -m "Sync notebooks"
- name: Pull with rebase
run: git pull --rebase

- name: Push changes
run: git push origin HEAD:master

0 comments on commit c30ddcb

Please sign in to comment.