Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions .github/workflows/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
git config --global user.email 'jimboid@users.noreply.github.com'

- name: change, log and push changes
id: update
run: |
if [ -z "$(git ls-remote --heads origin version-updates)" ]; then
echo "no branch version-updates, creating"
Expand All @@ -39,17 +40,24 @@ jobs:
fi
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
cat workshop.json
git add .
git commit -am "update ${{ github.event.client_payload.repo }} version to ${{ github.event.client_payload.tag }}"
if [ -z "$(git ls-remote --heads origin version-updates)" ]; then
echo "branch does not have upstream set, setting"
git push --set-upstream origin version-updates
if [ -z "$(git status --porcelain)" ]; then
echo "no changes detected"
echo "changes=false" >> "$GITHUB_OUTPUT"
else
echo "pushing changes"
git push
fi
git add .
git commit -am "update ${{ github.event.client_payload.repo }} version to ${{ github.event.client_payload.tag }}"
if [ -z "$(git ls-remote --heads origin version-updates)" ]; then
echo "branch does not have upstream set, setting"
git push --set-upstream origin version-updates
else
echo "pushing changes"
git push
echo "changes=true" >> "$GITHUB_OUTPUT"
fi
fi

- name: check pr exists
if: '!steps.updates.outputs.changes'
id: checkpr
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -66,7 +74,7 @@ jobs:
fi

- name: send PR
if: '!steps.checkpr.outputs.exists'
if: 'steps.updates.outputs.changes' && '!steps.checkpr.outputs.exists'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down