Skip to content

Commit 5bd0d8a

Browse files
committed
chore: add check to ensure version is different
1 parent ab80d52 commit 5bd0d8a

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

.github/workflows/update.version.in.config.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ jobs:
2929
exit 1
3030
3131
- name: Validate supplied app version format
32-
if: ${{ github.event.inputs.max_app_version != '' }}
3332
run: |
3433
NEW_MAX_APP_VERSION="${{ github.event.inputs.max_app_version }}"
3534
@@ -40,29 +39,26 @@ jobs:
4039
4140
- name: Determine new max app version
4241
id: set-max-app-version
42+
working-directory: packages/clippy/src/features/config
43+
run: |
44+
NEW_MAX_APP_VERSION="${{ github.event.inputs.max_app_version }}"
45+
echo "NEW MAX APP VERSION = ${NEW_MAX_APP_VERSION}"
46+
echo "new_max_app_version=${NEW_MAX_APP_VERSION}" >> "$GITHUB_OUTPUT"
47+
48+
- name: Ensure that the new max version is different from the current version
4349
working-directory: packages/clippy/src/features/config
4450
run: |
4551
CURRENT_MAX_APP_VERSION=$(jq -r '.deposits.showAppPayDepositMaxVersion' config.json)
46-
echo "CURRENT MAX APP VERSION: ${CURRENT_MAX_APP_VERSION}"
52+
NEW_MAX_APP_VERSION="${{ github.event.inputs.max_app_version }}"
4753
48-
if [[ "${{ github.event.inputs.max_app_version }}" != "" ]]; then
49-
NEW_MAX_APP_VERSION="${{ github.event.inputs.max_app_version }}"
50-
else
51-
echo "Max app version was not supplied"
52-
exit 1
54+
if [[ "$NEW_MAX_APP_VERSION" == "$CURRENT_MAX_APP_VERSION" ]]; then
55+
echo " Version hasn't changed — not committing."
56+
exit 78
5357
fi
5458
55-
echo "NEW MAX APP VERSION = ${NEW_MAX_APP_VERSION}"
56-
echo "new_max_app_version=${NEW_MAX_APP_VERSION}" >> "$GITHUB_OUTPUT"
57-
5859
- name: Update config.json with new app version
5960
working-directory: packages/clippy/src/features/config
6061
run: |
61-
if [[ -z "${{ steps.set-max-app-version.outputs.new_max_app_version }}" ]]; then
62-
echo "Failed to determine new max app version"
63-
exit 1
64-
fi
65-
6662
jq --arg version "${{ steps.set-max-app-version.outputs.new_max_app_version }}" '.deposits.showAppPayDepositMaxVersion = $version' config.json > config.temp.json
6763
mv config.temp.json config.json
6864

0 commit comments

Comments
 (0)