29
29
exit 1
30
30
31
31
- name : Validate supplied app version format
32
- if : ${{ github.event.inputs.max_app_version != '' }}
33
32
run : |
34
33
NEW_MAX_APP_VERSION="${{ github.event.inputs.max_app_version }}"
35
34
@@ -40,29 +39,26 @@ jobs:
40
39
41
40
- name : Determine new max app version
42
41
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
43
49
working-directory : packages/clippy/src/features/config
44
50
run : |
45
51
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 } }"
47
53
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
53
57
fi
54
58
55
- echo "NEW MAX APP VERSION = ${NEW_MAX_APP_VERSION}"
56
- echo "new_max_app_version=${NEW_MAX_APP_VERSION}" >> "$GITHUB_OUTPUT"
57
-
58
59
- name : Update config.json with new app version
59
60
working-directory : packages/clippy/src/features/config
60
61
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
-
66
62
jq --arg version "${{ steps.set-max-app-version.outputs.new_max_app_version }}" '.deposits.showAppPayDepositMaxVersion = $version' config.json > config.temp.json
67
63
mv config.temp.json config.json
68
64
0 commit comments