Skip to content

Commit 2bd9673

Browse files
committed
syncVersions: post-sync Slack version, bash [[ style
- Export POST_SYNC_APP_VERSION from Verify (jq after sync) for Slack; fixes stale semver when full npm version path ran (Codex r3097623955). - Use [[ ]] and == per Expensify shell style guide (roryabraham review). Made-with: Cursor
1 parent 64778b1 commit 2bd9673

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

.github/workflows/syncVersions.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,17 @@ jobs:
6262
echo "APP_VERSION=$APP_VERSION" >> "$GITHUB_OUTPUT"
6363
echo "ME_VERSION=$ME_VERSION" >> "$GITHUB_OUTPUT"
6464
65-
if [ "$RECORDED_SHA" != "$ACTUAL_SHA" ]; then
65+
if [[ "$RECORDED_SHA" != "$ACTUAL_SHA" ]]; then
6666
echo "::warning::⚠️ Submodule pointer is behind Mobile-Expensify main (recorded $RECORDED_SHA, latest $ACTUAL_SHA)"
6767
fi
6868
69-
if [ "$APP_VERSION" = "$ME_VERSION" ] && [ "$RECORDED_SHA" = "$ACTUAL_SHA" ]; then
69+
if [[ "$APP_VERSION" == "$ME_VERSION" && "$RECORDED_SHA" == "$ACTUAL_SHA" ]]; then
7070
echo "::notice::✅ Versions and submodule are in sync ($APP_VERSION @ $ACTUAL_SHA)"
7171
echo "IN_SYNC=true" >> "$GITHUB_OUTPUT"
7272
echo "NEED_FULL_VERSION_SYNC=false" >> "$GITHUB_OUTPUT"
7373
else
7474
echo "IN_SYNC=false" >> "$GITHUB_OUTPUT"
75-
if [ "$APP_VERSION" != "$ME_VERSION" ]; then
75+
if [[ "$APP_VERSION" != "$ME_VERSION" ]]; then
7676
echo "::warning::⚠️ Versions are out of sync - E/App: $APP_VERSION, Mobile-Expensify: $ME_VERSION"
7777
echo "NEED_FULL_VERSION_SYNC=true" >> "$GITHUB_OUTPUT"
7878
else
@@ -85,7 +85,7 @@ jobs:
8585
if: steps.checkVersions.outputs.IN_SYNC != 'true' && steps.checkVersions.outputs.NEED_FULL_VERSION_SYNC == 'true'
8686
id: targetVersion
8787
run: |
88-
if [ -n "${{ inputs.TARGET_VERSION }}" ]; then
88+
if [[ -n "${{ inputs.TARGET_VERSION }}" ]]; then
8989
echo "Using provided target version: ${{ inputs.TARGET_VERSION }}"
9090
echo "VERSION=${{ inputs.TARGET_VERSION }}" >> "$GITHUB_OUTPUT"
9191
else
@@ -151,7 +151,7 @@ jobs:
151151
run: |
152152
EXPECTED_SHA="${{ steps.submoduleRemote.outputs.ACTUAL_SHA }}"
153153
CURRENT_SHA=$(git -C Mobile-Expensify rev-parse HEAD)
154-
if [ "$CURRENT_SHA" != "$EXPECTED_SHA" ]; then
154+
if [[ "$CURRENT_SHA" != "$EXPECTED_SHA" ]]; then
155155
echo "::error::Mobile-Expensify checkout ($CURRENT_SHA) does not match expected main ($EXPECTED_SHA)"
156156
exit 1
157157
fi
@@ -175,12 +175,13 @@ jobs:
175175
echo "::notice::✅ Submodule pointer updated on App main"
176176
177177
- name: Verify sync completed
178+
id: verifySync
178179
if: steps.checkVersions.outputs.IN_SYNC != 'true'
179180
run: |
180181
APP_VERSION=$(jq -r .version package.json)
181182
ME_VERSION=$(jq -r .meta.version Mobile-Expensify/app/config/config.json)
182183
183-
if [ "$APP_VERSION" != "$ME_VERSION" ]; then
184+
if [[ "$APP_VERSION" != "$ME_VERSION" ]]; then
184185
echo "::error::Sync failed! Versions still don't match"
185186
echo "::error::E/App: $APP_VERSION, Mobile-Expensify: $ME_VERSION"
186187
exit 1
@@ -190,11 +191,12 @@ jobs:
190191
191192
RECORDED=$(git rev-parse HEAD:Mobile-Expensify)
192193
REMOTE_SHA=$(git -C Mobile-Expensify rev-parse origin/main)
193-
if [ "$RECORDED" != "$REMOTE_SHA" ]; then
194+
if [[ "$RECORDED" != "$REMOTE_SHA" ]]; then
194195
echo "::error::Submodule on App main ($RECORDED) still differs from Mobile-Expensify origin/main ($REMOTE_SHA)"
195196
exit 1
196197
fi
197198
199+
echo "POST_SYNC_APP_VERSION=$APP_VERSION" >> "$GITHUB_OUTPUT"
198200
echo "::notice::✅ Verified versions ($APP_VERSION) and submodule match Mobile-Expensify main ($RECORDED)"
199201
200202
- name: Announce sync in Slack
@@ -208,7 +210,7 @@ jobs:
208210
channel: '#deployer',
209211
attachments: [{
210212
color: "good",
211-
text: `✅ Version sync completed. E/App and Mobile-Expensify are at ${{ steps.checkVersions.outputs.APP_VERSION }}; submodule matches Mobile-Expensify main.`
213+
text: `✅ Version sync completed. E/App and Mobile-Expensify are at ${{ steps.verifySync.outputs.POST_SYNC_APP_VERSION }}; submodule matches Mobile-Expensify main.`
212214
}]
213215
}
214216
env:

0 commit comments

Comments
 (0)