Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/check_for_changes_in_NP_jsons.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Check for changes in NP json files

on:
schedule:
- cron: '0 0 * * 2' # Every Tuesday at 00:00 UTC
workflow_dispatch:

# Grant permissions for the job to write to contents (push) and create PRs.
permissions:
contents: write
pull-requests: write

jobs:
build-and-pr:
runs-on: ubuntu-latest
steps:

- name: Check out local repository
uses: actions/checkout@v4

# Set up a Python environment
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

# Clone dev version of probeinterface
- name: Clone external repository
run: |
git clone https://github.com/spikeinterface/probeinterface ./probeinterface

- name: Install probeinterface and matplotlib
run: pip install ./probeinterface matplotlib

- name: Generate full NP library
run: |
cd scripts/
python ../probeinterface/resources/generate_neuropixels_library.py

# Check for any new probes
- name: Run local script
run: |
rsync -av --include='*/' --include='*.json' --exclude='*' scripts/neuropixels_library_generated/ imec/
rm -r scripts/neuropixels_library_generated/
rm -r ./probeinterface

- name: Commit changes if any
id: commit
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"

git add imec/*

# Only commit if there are changes
if git diff --staged --quiet; then
echo "No changes to commit"
echo "changes=false" >> $GITHUB_OUTPUT
else
git commit -m "Update json files for NP probes"
echo "changes=true" >> $GITHUB_OUTPUT
fi

- name: Create pull request to add probes
if: steps.commit.outputs.changes == 'true'
uses: peter-evans/create-pull-request@v7
with:
title: "Update Neuropixels json files"
body: "This PR updates the Neuropixel probes in probeinterace library, based on new data from the ProbeTable repository or because of a new ProbeInterface release."
branch-suffix: short-commit-hash
base: "main"
6 changes: 0 additions & 6 deletions .github/workflows/check_for_new_probes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ jobs:
# Clone dev version of probeinterface
- name: Clone external repository
run: |
# --- USER ACTION REQUIRED ---
# Replace this URL with the repository you want to clone.
# If it's a private repo, your GH_PAT must have access.
git clone https://github.com/spikeinterface/probeinterface ./probeinterface

- name: Install probeinterface and matplotlib
Expand All @@ -43,9 +40,6 @@ jobs:
# Check for any new probes
- name: Run local script
run: |
# --- USER ACTION REQUIRED ---
# Replace this path with the correct path to your local script
ls
cd scripts/
python check_for_new_NP_probes.py
rm -r neuropixels_library_generated/
Expand Down
Loading