Skip to content

Commit 49cb9d8

Browse files
committed
try latest fixes
1 parent c75753f commit 49cb9d8

File tree

1 file changed

+15
-25
lines changed

1 file changed

+15
-25
lines changed

.github/workflows/update-python.yaml

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,20 @@ jobs:
4343
run: |
4444
sed -i "s/rev: .* # ruff version/rev: v${{ env.RUFF_VERSION }} # ruff version/" ${{ env.PYTHON_TEMPLATE_LOCATION }}/.pre-commit-config.yaml
4545
46-
- name: Create new branch for changes
46+
- name: Create new branch, commit, and push changes
4747
run: |
4848
git checkout -b update-ruff-${{ env.RUFF_VERSION }}
49-
50-
- name: Commit and push changes
51-
run: |
5249
git config --local user.email "action@github.com"
5350
git config --local user.name "GitHub Action"
5451
git add ${{ env.PYTHON_TEMPLATE_LOCATION }}/pyproject.toml ${{ env.PYTHON_TEMPLATE_LOCATION }}/.pre-commit-config.yaml
55-
git commit -m "Update ruff version to ${{ env.RUFF_VERSION }}" || exit 0 # Exit gracefully if no changes
56-
git push --set-upstream origin update-ruff-${{ env.RUFF_VERSION }}
57-
58-
- name: Check if there are new commits
59-
id: check_commits
60-
run: |
52+
git commit -m "Update ruff version to ${{ env.RUFF_VERSION }}"
6153
if git diff --quiet origin/main..; then
6254
echo "new_commits=false" >> $GITHUB_ENV
55+
exit 0
6356
else
6457
echo "new_commits=true" >> $GITHUB_ENV
6558
fi;
59+
git push --set-upstream origin update-ruff-${{ env.RUFF_VERSION }}
6660
6761
- name: Create pull request
6862
if: env.new_commits == 'true'
@@ -110,22 +104,20 @@ jobs:
110104
run: |
111105
git checkout -b update-precommit-${{ env.PRECOMMIT_VERSION }}
112106
113-
- name: Commit and push changes
107+
- name: Create new branch, commit, and push changes
114108
run: |
109+
git checkout -b update-ruff-${{ env.RUFF_VERSION }}
115110
git config --local user.email "action@github.com"
116111
git config --local user.name "GitHub Action"
117112
git add ${{ env.PYTHON_TEMPLATE_LOCATION }}/pyproject.toml ${{ env.PYTHON_TEMPLATE_LOCATION }}/.pre-commit-config.yaml
118-
git commit -m "Update precommit version to ${{ env.PRECOMMIT_VERSION }}" || exit 0 # Exit gracefully if no changes
119-
git push --set-upstream origin update-precommit-${{ env.PRECOMMIT_VERSION }}
120-
121-
- name: Check if there are new commits
122-
id: check_commits
123-
run: |
113+
git commit -m "Update ruff version to ${{ env.RUFF_VERSION }}"
124114
if git diff --quiet origin/main..; then
125115
echo "new_commits=false" >> $GITHUB_ENV
116+
exit 0
126117
else
127118
echo "new_commits=true" >> $GITHUB_ENV
128119
fi;
120+
git push --set-upstream origin update-ruff-${{ env.RUFF_VERSION }}
129121
130122
- name: Create pull request
131123
if: env.new_commits == 'true'
@@ -166,22 +158,20 @@ jobs:
166158
run: |
167159
git checkout -b update-precommit-hooks-${{ env.PRECOMMIT_HOOKS_VERSION }}
168160
169-
- name: Commit and push changes
161+
- name: Create new branch, commit, and push changes
170162
run: |
163+
git checkout -b update-ruff-${{ env.RUFF_VERSION }}
171164
git config --local user.email "action@github.com"
172165
git config --local user.name "GitHub Action"
173-
git add ${{ env.PYTHON_TEMPLATE_LOCATION }}/.pre-commit-config.yaml
174-
git commit -m "Update pre-commit-hooks version to ${{ env.PRECOMMIT_HOOKS_VERSION }}" || exit 0 # Exit gracefully if no changes
175-
git push --set-upstream origin update-precommit-hooks-${{ env.PRECOMMIT_HOOKS_VERSION }}
176-
177-
- name: Check if there are new commits
178-
id: check_commits
179-
run: |
166+
git add ${{ env.PYTHON_TEMPLATE_LOCATION }}/pyproject.toml ${{ env.PYTHON_TEMPLATE_LOCATION }}/.pre-commit-config.yaml
167+
git commit -m "Update ruff version to ${{ env.RUFF_VERSION }}"
180168
if git diff --quiet origin/main..; then
181169
echo "new_commits=false" >> $GITHUB_ENV
170+
exit 0
182171
else
183172
echo "new_commits=true" >> $GITHUB_ENV
184173
fi;
174+
git push --set-upstream origin update-ruff-${{ env.RUFF_VERSION }}
185175
186176
- name: Create pull request
187177
if: env.new_commits == 'true'

0 commit comments

Comments
 (0)