Skip to content

Commit

Permalink
Merge pull request #6199 from Expensify/joe-check-bundle-version
Browse files Browse the repository at this point in the history
[No QA] Ensure bundle version strings are compatible before auto-merging CP PR
  • Loading branch information
Jag96 authored Nov 17, 2021
2 parents dc4f1f3 + 1557ae8 commit a61cfb4
Show file tree
Hide file tree
Showing 5 changed files with 1,290 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .github/actions/checkBundleVersionStringMatch/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: 'Check if Bundle Versions Match'
description: "Check if the CFBundleVersion string is compatible with the CFBundleShortVersionString"
outputs:
BUNDLE_VERSIONS_MATCH:
description: Whether or not the bundle versions match
runs:
using: 'node12'
main: './index.js'
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const core = require('@actions/core');
const {execSync} = require('child_process');
const {PLIST_PATH} = require('../../libs/nativeVersionUpdater');

const bundleVersion = execSync(`/usr/libexec/PlistBuddy -c "Print :CFBundleVersion" ${PLIST_PATH}`);
const shortBundleVersion = execSync(`/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" ${PLIST_PATH}`);

console.log(`Bundle Version: ${bundleVersion}`);
console.log(`Short Bundle Version: ${shortBundleVersion}`);
if (shortBundleVersion !== (bundleVersion.split('-') || [''])[0]) {
console.log('Bundle Versions do not match');
core.setOutput('BUNDLE_VERSIONS_MATCH', false);
} else {
console.log('Bundle Versions match');
core.setOutput('BUNDLE_VERSIONS_MATCH', true);
}
Loading

0 comments on commit a61cfb4

Please sign in to comment.