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"
54+ if [[ "$NEW_MAX_APP_VERSION" == "$CURRENT_MAX_APP_VERSION" ]]; then
55+ echo " Version hasn't changed — not committing."
5256 exit 1
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