Skip to content

Commit 955552c

Browse files
authored
Update version.yaml
1 parent 0faf784 commit 955552c

1 file changed

Lines changed: 17 additions & 9 deletions

File tree

.github/workflows/version.yaml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
git config --global user.email 'jimboid@users.noreply.github.com'
3030
3131
- name: change, log and push changes
32+
id: update
3233
run: |
3334
if [ -z "$(git ls-remote --heads origin version-updates)" ]; then
3435
echo "no branch version-updates, creating"
@@ -39,17 +40,24 @@ jobs:
3940
fi
4041
jq --arg a "${{ github.event.client_payload.tag }}" '.containers."${{ github.event.client_payload.repo }}".latest = ($a)' workshop.json | jq "." | cat > workshop2.json; mv workshop2.json workshop.json
4142
cat workshop.json
42-
git add .
43-
git commit -am "update ${{ github.event.client_payload.repo }} version to ${{ github.event.client_payload.tag }}"
44-
if [ -z "$(git ls-remote --heads origin version-updates)" ]; then
45-
echo "branch does not have upstream set, setting"
46-
git push --set-upstream origin version-updates
43+
if [ -z "$(git status --porcelain)" ]; then
44+
echo "no changes detected"
45+
echo "changes=false" >> "$GITHUB_OUTPUT"
4746
else
48-
echo "pushing changes"
49-
git push
50-
fi
47+
git add .
48+
git commit -am "update ${{ github.event.client_payload.repo }} version to ${{ github.event.client_payload.tag }}"
49+
if [ -z "$(git ls-remote --heads origin version-updates)" ]; then
50+
echo "branch does not have upstream set, setting"
51+
git push --set-upstream origin version-updates
52+
else
53+
echo "pushing changes"
54+
git push
55+
echo "changes=true" >> "$GITHUB_OUTPUT"
56+
fi
57+
fi
5158
5259
- name: check pr exists
60+
if: '!steps.updates.outputs.changes'
5361
id: checkpr
5462
env:
5563
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -66,7 +74,7 @@ jobs:
6674
fi
6775
6876
- name: send PR
69-
if: '!steps.checkpr.outputs.exists'
77+
if: 'steps.updates.outputs.changes' && '!steps.checkpr.outputs.exists'
7078
env:
7179
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7280
run: |

0 commit comments

Comments
 (0)