Skip to content

Commit 99e4b3b

Browse files
committed
protect fixes
1 parent 6f0a75d commit 99e4b3b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

.github/workflows/update-python.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ jobs:
4545
4646
- name: Create new branch, commit, and push changes
4747
run: |
48-
git checkout -b update-ruff-${{ env.RUFF_VERSION }}
4948
git config --local user.email "action@github.com"
5049
git config --local user.name "GitHub Action"
51-
git add ${{ env.PYTHON_TEMPLATE_LOCATION }}/pyproject.toml ${{ env.PYTHON_TEMPLATE_LOCATION }}/.pre-commit-config.yaml
5250
if git diff --quiet origin/main..; then
5351
echo "new_commits=false" >> $GITHUB_ENV
5452
exit 0
5553
else
54+
git checkout -b update-ruff-${{ env.RUFF_VERSION }}
55+
git add ${{ env.PYTHON_TEMPLATE_LOCATION }}/pyproject.toml ${{ env.PYTHON_TEMPLATE_LOCATION }}/.pre-commit-config.yaml
5656
git commit -m "Update ruff version to ${{ env.RUFF_VERSION }}"
5757
echo "new_commits=true" >> $GITHUB_ENV
5858
fi;
@@ -102,14 +102,14 @@ jobs:
102102
103103
- name: Create new branch, commit, and push changes
104104
run: |
105-
git checkout -b update-precommit-${{ env.PRECOMMIT_VERSION }}
106105
git config --local user.email "action@github.com"
107106
git config --local user.name "GitHub Action"
108-
git add ${{ env.PYTHON_TEMPLATE_LOCATION }}/pyproject.toml ${{ env.PYTHON_TEMPLATE_LOCATION }}/.pre-commit-config.yaml
109107
if git diff --quiet origin/main..; then
110108
echo "new_commits=false" >> $GITHUB_ENV
111109
exit 0
112110
else
111+
git checkout -b update-precommit-${{ env.PRECOMMIT_VERSION }}
112+
git add ${{ env.PYTHON_TEMPLATE_LOCATION }}/pyproject.toml ${{ env.PYTHON_TEMPLATE_LOCATION }}/.pre-commit-config.yaml
113113
git commit -m "Update precommit to ${{ env.PRECOMMIT_VERSION }}"
114114
echo "new_commits=true" >> $GITHUB_ENV
115115
fi;
@@ -152,14 +152,14 @@ jobs:
152152
153153
- name: Create new branch, commit, and push changes
154154
run: |
155-
git checkout -b update-precommit-hooks-${{ env.PRECOMMIT_HOOKS_VERSION }}
156155
git config --local user.email "action@github.com"
157156
git config --local user.name "GitHub Action"
158-
git add ${{ env.PYTHON_TEMPLATE_LOCATION }}/.pre-commit-config.yaml
159157
if git diff --quiet origin/main..; then
160158
echo "new_commits=false" >> $GITHUB_ENV
161159
exit 0
162160
else
161+
git checkout -b update-precommit-hooks-${{ env.PRECOMMIT_HOOKS_VERSION }}
162+
git add ${{ env.PYTHON_TEMPLATE_LOCATION }}/.pre-commit-config.yaml
163163
git commit -m "Update pre-commit-hooks version to ${{ env.PRECOMMIT_HOOKS_VERSION }}"
164164
echo "new_commits=true" >> $GITHUB_ENV
165165
fi;

0 commit comments

Comments
 (0)