Skip to content

Commit c0568fe

Browse files
committed
Fix copy-files action by making a PR
1 parent 44baa04 commit c0568fe

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/workflows/copy_probe_features.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,27 @@ jobs:
2020
https://raw.githubusercontent.com/billkarsh/ProbeTable/refs/heads/main/Tables/probe_features.json
2121
2222
- name: Commit changes if any
23+
id: commit
2324
run: |
2425
git config --local user.email "action@github.com"
2526
git config --local user.name "GitHub Action"
2627
2728
git add src/probeinterface/resources/neuropixels_probe_features.json
2829
2930
# Only commit if there are changes
30-
git diff --staged --quiet || git commit -m "Update neuropixels_probe_features from ProbeTable"
31-
git push
31+
if git diff --staged --quiet; then
32+
echo "No changes to commit"
33+
echo "changes=false" >> $GITHUB_OUTPUT
34+
else
35+
git commit -m "Update neuropixels_probe_features from ProbeTable"
36+
echo "changes=true" >> $GITHUB_OUTPUT
37+
fi
38+
39+
- name: Make PR with updated probe features
40+
if: steps.commit.outputs.changes == 'true'
41+
uses: peter-evans/create-pull-request@v7
42+
with:
43+
title: "Update Neuropixels probe features"
44+
body: "This PR updates the probe features JSON file from the ProbeTable repository."
45+
branch-suffix: short-commit-hash
46+
base: "main"

0 commit comments

Comments
 (0)