Skip to content

Commit e9c78dd

Browse files
committed
only push to one branch
1 parent 6cc475d commit e9c78dd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/nightly-build.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,21 @@ jobs:
2323
fetch-depth: 0
2424
token: ${{ secrets.GITHUB_TOKEN }}
2525

26+
- name: Check if nightly branch already exists
27+
run: |
28+
BRANCH_NAME="nightly-dependency-updates"
29+
if git ls-remote --exit-code --heads origin "$BRANCH_NAME"; then
30+
echo "Branch $BRANCH_NAME already exists. Skipping run to avoid conflicts."
31+
echo "Please merge or close the existing PR before the next nightly run."
32+
exit 0
33+
fi
34+
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
35+
2636
- name: Configure git and create branch
2737
run: |
2838
git config --local user.email "[email protected]"
2939
git config --local user.name "GitHub Action"
30-
BRANCH_NAME="nightly-deps-$(date +%Y%m%d)"
3140
git checkout -b "$BRANCH_NAME"
32-
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
3341
3442
- name: Set up Python
3543
uses: actions/setup-python@v4

0 commit comments

Comments
 (0)