@@ -28,35 +28,25 @@ jobs:
2828 git config --global user.name 'jimboid'
2929 git config --global user.email 'jimboid@users.noreply.github.com'
3030
31- - name : update json
32- run : |
33- 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
34-
35- - name : log the change
31+ - name : change, log and push changes
3632 run : |
33+ if [ -z "$(git ls-remote --heads origin version-updates)" ]; then
34+ echo "no branch version-updates, creating"
35+ git checkout -b version-updates
36+ else
37+ echo "branch exists, checking it out"
38+ git checkout version-updates
39+ fi
40+ 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
3741 cat workshop.json
38-
39- - name : push changes
40- run : |
41- if [ -z "$(git status --porcelain)" ]; then
42- echo "no changes detected"
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
4347 else
44- if [ -z "$(git ls-remote --heads origin version-updates)" ]; then
45- echo "no branch version-updates, creating"
46- git checkout -b version-updates
47- else
48- echo "branch exists, checking it out"
49- git checkout version-updates
50- fi
51- git add .
52- git commit -am "update ${{ github.event.client_payload.repo }} version to ${{ github.event.client_payload.tag }}"
53- if [ -z "$(git ls-remote --heads origin version-updates)" ]; then
54- echo "branch does not have upstream set, setting"
55- git push --set-upstream origin version-updates
56- else
57- echo "pushing changes"
58- git push
59- fi
48+ echo "pushing changes"
49+ git push
6050 fi
6151
6252 - name : check pr exists
0 commit comments