Compare commits

..
2 Commits
14 changed files with 222 additions and 30 deletions

No files matched your search

+6
View File
@@ -1,3 +1,9 @@
## [9.0.2](https://github.com/expo/expo-github-action/compare/9.0.1...9.0.2) (2026-11-06)
### Bug fixes
* **preview:** Honor native scheme overrides in development build QR codes ([#365](https://github.com/expo/expo-github-action/issues/365)) ([f2443cd](https://github.com/expo/expo-github-action/commit/f2443cd44215902958beadca9aa808395ff56eba))
## [9.0.1](https://github.com/expo/expo-github-action/compare/9.0.0...9.0.1) (2026-10-20)
### Bug fixes
+16 -3
View File
@@ -34859,7 +34859,16 @@ async function createUpdate(cwd, command) {
/**
* Create a QR code link for an EAS Update.
*/
function getUpdateGroupQr({ projectId, updateGroupId, appSlug, qrTarget, }) {
function getUpdateGroupQr({ projectId, updateGroupId, appSlug, appScheme, qrTarget, }) {
if (qrTarget === 'dev-build' && appScheme) {
// /eas-update treats appScheme as a slug and prefixes it with exp+.
// /development-client uses the native scheme verbatim instead.
const url = new url_1.URL('https://qr.expo.dev/development-client');
const host = process.env.EXPO_STAGING ? 'staging-u.expo.dev' : 'u.expo.dev';
url.searchParams.append('appScheme', appScheme);
url.searchParams.append('url', `https://${host}/${projectId}/group/${updateGroupId}`);
return url.toString();
}
const url = new url_1.URL('https://qr.expo.dev/eas-update');
if (qrTarget === 'dev-build') {
// While the parameter is called `appScheme`, it's actually the app's slug
@@ -37555,6 +37564,7 @@ function collectContinuousDeployFingerprintInput() {
branch: (0, input_1.getInput)('branch', { required: true }),
platform: platformInput,
environment: (0, input_1.getInput)('environment'),
appScheme: (0, input_1.getInput)('app-scheme') || undefined,
autoSubmitBuilds: (0, input_1.getInput)('auto-submit-builds') === 'true',
githubToken: (0, input_1.getInput)('github-token', { required: true }),
workingDirectory: (0, input_1.getInput)('working-directory', { required: true }),
@@ -37714,7 +37724,8 @@ async function publishEASUpdatesAsync({ cwd, branch, environment, platform, }) {
function createSummaryForUpdatesAndBuilds({ config, projectId, updates, buildRunInfos, options, }) {
const appSlug = config.slug;
const qrTarget = (0, comment_1.getQrTarget)(options);
const appSchemes = (0, comment_1.getSchemesInOrderFromConfig)(config) || [];
const appScheme = options.appScheme;
const appSchemes = appScheme ? [appScheme] : (0, comment_1.getSchemesInOrderFromConfig)(config) || [];
const { androidBuildRunInfo, iosBuildRunInfo } = buildRunInfos;
const androidUpdate = updates.find(update => update.platform === 'android');
const iosUpdate = updates.find(update => update.platform === 'ios');
@@ -37722,7 +37733,9 @@ function createSummaryForUpdatesAndBuilds({ config, projectId, updates, buildRun
const getUpdateLink = (update) => update
? `[Update Permalink](${(0, eas_1.getUpdateGroupWebsite)({ projectId, updateGroupId: update.group })})`
: 'n/a';
const getUpdateQRURL = (update) => update ? (0, eas_1.getUpdateGroupQr)({ projectId, updateGroupId: update.group, appSlug, qrTarget }) : null;
const getUpdateQRURL = (update) => update
? (0, eas_1.getUpdateGroupQr)({ projectId, updateGroupId: update.group, appSlug, appScheme, qrTarget })
: null;
const getBuildDetails = (buildRunInfo) => getBuildLink(buildRunInfo.buildInfo) +
'<br />' +
(0, comment_1.createDetails)({
+26 -7
View File
@@ -34780,6 +34780,7 @@ function previewInput() {
}
return {
command: (0, core_1.getInput)('command'),
appScheme: (0, core_1.getInput)('app-scheme') || undefined,
shouldComment: !(0, core_1.getInput)('comment') || (0, core_1.getBooleanInput)('comment'),
commentId: (0, core_1.getInput)('comment-id') || exports.MESSAGE_ID,
workingDirectory: (0, core_1.getInput)('working-directory'),
@@ -34857,7 +34858,8 @@ function getVariables(config, updates, options) {
const projectId = config.extra?.eas?.projectId;
const android = updates.find(update => update.platform === 'android');
const ios = updates.find(update => update.platform === 'ios');
const appSchemes = (0, comment_1.getSchemesInOrderFromConfig)(config) || [];
const appScheme = options.appScheme;
const appSchemes = appScheme ? [appScheme] : (0, comment_1.getSchemesInOrderFromConfig)(config) || [];
const appSlug = config.slug;
const qrTarget = (0, comment_1.getQrTarget)(options);
return {
@@ -34865,13 +34867,19 @@ function getVariables(config, updates, options) {
projectId,
projectName: config.name,
projectSlug: appSlug,
projectScheme: appSchemes[0] || '', // This is the longest scheme from one or more custom app schemes
projectSchemes: JSON.stringify(appSchemes), // These are all custom app schemes, in order from longest to shortest as JSON
projectScheme: appSchemes[0] || '', // The override, or the longest configured app scheme
projectSchemes: JSON.stringify(appSchemes), // The override, or configured app schemes in priority order as JSON
// Shared update properties
// Note, only use these properties when the update groups are identical
groupId: updates[0].group,
runtimeVersion: updates[0].runtimeVersion,
qr: (0, eas_1.getUpdateGroupQr)({ projectId, updateGroupId: updates[0].group, appSlug, qrTarget }),
qr: (0, eas_1.getUpdateGroupQr)({
projectId,
updateGroupId: updates[0].group,
appSlug,
appScheme,
qrTarget,
}),
link: (0, eas_1.getUpdateGroupWebsite)({ projectId, updateGroupId: updates[0].group }),
// These are safe to access regardless of the update groups
branchName: updates[0].branch,
@@ -34886,7 +34894,7 @@ function getVariables(config, updates, options) {
androidMessage: android?.message || '',
androidRuntimeVersion: android?.runtimeVersion || '',
androidQR: android
? (0, eas_1.getUpdateGroupQr)({ projectId, updateGroupId: android.group, appSlug, qrTarget })
? (0, eas_1.getUpdateGroupQr)({ projectId, updateGroupId: android.group, appSlug, appScheme, qrTarget })
: '',
androidLink: android ? (0, eas_1.getUpdateGroupWebsite)({ projectId, updateGroupId: android.group }) : '',
// iOS update
@@ -34896,7 +34904,9 @@ function getVariables(config, updates, options) {
iosManifestPermalink: ios?.manifestPermalink || '',
iosMessage: ios?.message || '',
iosRuntimeVersion: ios?.runtimeVersion || '',
iosQR: ios ? (0, eas_1.getUpdateGroupQr)({ projectId, updateGroupId: ios.group, appSlug, qrTarget }) : '',
iosQR: ios
? (0, eas_1.getUpdateGroupQr)({ projectId, updateGroupId: ios.group, appSlug, appScheme, qrTarget })
: '',
iosLink: ios ? (0, eas_1.getUpdateGroupWebsite)({ projectId, updateGroupId: ios.group }) : '',
};
}
@@ -35071,7 +35081,16 @@ async function createUpdate(cwd, command) {
/**
* Create a QR code link for an EAS Update.
*/
function getUpdateGroupQr({ projectId, updateGroupId, appSlug, qrTarget, }) {
function getUpdateGroupQr({ projectId, updateGroupId, appSlug, appScheme, qrTarget, }) {
if (qrTarget === 'dev-build' && appScheme) {
// /eas-update treats appScheme as a slug and prefixes it with exp+.
// /development-client uses the native scheme verbatim instead.
const url = new url_1.URL('https://qr.expo.dev/development-client');
const host = process.env.EXPO_STAGING ? 'staging-u.expo.dev' : 'u.expo.dev';
url.searchParams.append('appScheme', appScheme);
url.searchParams.append('url', `https://${host}/${projectId}/group/${updateGroupId}`);
return url.toString();
}
const url = new url_1.URL('https://qr.expo.dev/eas-update');
if (qrTarget === 'dev-build') {
// While the parameter is called `appScheme`, it's actually the app's slug
+3
View File
@@ -65,8 +65,11 @@ Here is a summary of all the input options you can use.
| **working-directory** | - | The relative directory of your Expo app |
| **platform** | `all` | The platform to deploy on (available options are `ios`, `android` and `all`) |
| **auto-submit-builds** | - | Whether to add the `--auto-submit` flag to the issued `eas build` commands. |
| **app-scheme** | - | Override the native scheme shown in the comment and used for development-build QR codes. Omit it to use `exp+<slug>` for QR codes. Does not affect Expo Go QR codes. |
| **github-token** | `github.token` | GitHub token to use when commenting on PR ([read more](#github-tokens)) |
For development clients that do not register the generated `exp+<slug>` scheme (for example, bare projects or clients built with `addGeneratedScheme: false`), set `app-scheme` to the exact scheme registered by that client. This value is independent of the config evaluated on the runner, so it can target a development variant even when `eas update --environment ...` uses different environment variables.
And the action will generate these [outputs](#available-outputs) for other actions to do something based on what this action did.
### Available outputs
+3
View File
@@ -18,6 +18,9 @@ inputs:
environment:
description: The environment to use for server-side defined EAS environment variables during command execution
required: false
app-scheme:
description: Override the app scheme shown in the comment and used for development-build QR codes. Defaults to the generated exp+<slug> scheme for QR codes. Does not affect Expo Go QR codes.
required: false
platform:
description: The platform on which to publish. Possible values are 'all' | 'android' | 'ios'
required: false
+1 -1
View File
@@ -1,7 +1,7 @@
{
"private": true,
"name": "expo-github-action",
"version": "9.0.1",
"version": "9.0.2",
"description": "Expo CLI in your GitHub Actions workflow",
"main": "build/index.js",
"repository": {
+5 -2
View File
@@ -49,8 +49,11 @@ Here is a summary of all the input options you can use.
| **comment** | `true` | If the action should summarize the EAS Update information as comment on a pull request |
| **comment-id** | _[see code][code-defaults]_ | Unique id template to prevent duplicate comments ([read more](#preventing-duplicate-comments)) |
| **qr-target** | _inferred from project_ | Either `dev-build` or `expo-go`, affects how the EAS Update is opened through the QR code. <br /> Defaults to `dev-build` when `expo-dev-client` is detected within the project. |
| **app-scheme** | - | Override the native scheme shown in the comment and used for development-build QR codes. Omit it to use `exp+<slug>` for QR codes. Does not affect Expo Go QR codes. |
| **github-token** | `github.token` | GitHub token to use when commenting on PR ([read more](#github-tokens)) |
For development clients that do not register the generated `exp+<slug>` scheme (for example, bare projects or clients built with `addGeneratedScheme: false`), set `app-scheme` to the exact scheme registered by that client. This value is independent of the config evaluated on the runner, so it can target a development variant even when `eas update --environment ...` uses different environment variables.
## Available outputs
There are a few variables available that you can use to set up your own notifications.
@@ -61,8 +64,8 @@ These variables are strings; some may be empty because of your project configura
| **projectId** | The resolved EAS project ID |
| **projectName** | The name of your project ([read more](https://docs.expo.dev/versions/latest/config/app/#name)) |
| **projectSlug** | The slug of your project ([read more](https://docs.expo.dev/versions/latest/config/app/#slug)) |
| **projectScheme** | The longest (custom) app scheme ([read more](https://docs.expo.dev/versions/latest/config/app/#scheme)) |
| **projectSchemes** | All (custom) app schemes in order of longest to shortest, as JSON string ([read more](https://docs.expo.dev/versions/latest/config/app/#scheme)) |
| **projectScheme** | The `app-scheme` override, or longest configured app scheme ([read more](https://docs.expo.dev/versions/latest/config/app/#scheme)) |
| **projectSchemes** | The `app-scheme` override, or configured app schemes in order of longest to shortest, as a JSON string ([read more](https://docs.expo.dev/versions/latest/config/app/#scheme)) |
| **commentId** | The unique comment ID to prevent duplicate comments ([read more](#preventing-duplicate-comments)) |
| **comment** | The comment with information about the updates |
+2 -4
View File
@@ -29,10 +29,8 @@ inputs:
description: GitHub token to use when commenting on PR
required: false
default: ${{ github.token }}
# Below are deprecated and won't be supported anymore
app-scheme:
deprecated: true
description: The (custom) app scheme to use when creating the preview QR code
description: Override the app scheme shown in the comment and used for development-build QR codes. Defaults to the generated exp+<slug> scheme for QR codes. Does not affect Expo Go QR codes.
required: false
outputs:
projectId:
@@ -42,7 +40,7 @@ outputs:
projectSlug:
description: The slug of your project
projectScheme:
description: The (custom) app scheme
description: The app-scheme override, or the longest configured app scheme
commentId:
description: The unique comment ID to prevent duplicate comments
@@ -0,0 +1,26 @@
import { collectContinuousDeployFingerprintInput } from '../../actions/continuous-deploy-fingerprint';
jest.mock('../../worker');
describe(collectContinuousDeployFingerprintInput, () => {
it.each([
{ value: '', expected: undefined },
{ value: 'myapp-dev', expected: 'myapp-dev' },
])('reads the native scheme override "$value"', ({ value, expected }) => {
const previous = process.env;
process.env = {
...previous,
INPUT_PROFILE: 'development',
INPUT_BRANCH: 'preview-test',
INPUT_PLATFORM: 'all',
'INPUT_GITHUB-TOKEN': 'test-token',
'INPUT_WORKING-DIRECTORY': '.',
'INPUT_APP-SCHEME': value,
};
try {
expect(collectContinuousDeployFingerprintInput().appScheme).toBe(expected);
} finally {
process.env = previous;
}
});
});
+64 -4
View File
@@ -4,17 +4,25 @@ import { createSummary, getVariables, previewInput } from '../../actions/preview
import { EasUpdate } from '../../eas';
jest.mock('../../expo');
jest.mock('../../worker');
const fakeOptions = {
const fakeOptions: ReturnType<typeof previewInput> = {
command: 'eas update',
appScheme: undefined,
shouldComment: true,
commentId: 'preview-test',
workingDirectory: '.',
githubToken: 'test-token',
qrTarget: 'dev-client',
} as unknown as ReturnType<typeof previewInput>;
};
const fakeExpoConfig = {
const fakeExpoConfig: ExpoConfig = {
name: 'Fake project',
slug: 'fake-project',
extra: {
eas: { projectId: 'fake-project-id' },
},
} as unknown as ExpoConfig;
};
const fakeUpdatesSingle: EasUpdate[] = [
{
@@ -46,6 +54,58 @@ const fakeUpdatesMultiple = fakeUpdatesSingle.map(update => ({
group: `fake-group-${update.id}`,
}));
describe(previewInput, () => {
it('reads the native scheme override from the action input', () => {
const previous = process.env['INPUT_APP-SCHEME'];
process.env['INPUT_APP-SCHEME'] = 'myapp-dev';
try {
expect(previewInput().appScheme).toBe('myapp-dev');
} finally {
if (previous === undefined) {
delete process.env['INPUT_APP-SCHEME'];
} else {
process.env['INPUT_APP-SCHEME'] = previous;
}
}
});
});
describe(getVariables, () => {
it('keeps the generated scheme when config contains a variant-specific scheme', () => {
const vars = getVariables(
{ ...fakeExpoConfig, scheme: 'myapp-production' },
fakeUpdatesMultiple,
fakeOptions
);
for (const value of [vars.qr, vars.androidQR, vars.iosQR]) {
const qr = new URL(value);
expect(qr.origin + qr.pathname).toBe('https://qr.expo.dev/eas-update');
expect(qr.searchParams.get('appScheme')).toBe('fake-project');
}
});
it('uses an explicit native scheme for every update group and the comment', () => {
const options = { ...fakeOptions, appScheme: 'myapp-dev' };
const vars = getVariables(
{ ...fakeExpoConfig, scheme: ['myapp-production', 'com.example.third-party-long'] },
fakeUpdatesMultiple,
options
);
expect(vars.projectScheme).toBe('myapp-dev');
expect(JSON.parse(vars.projectSchemes)).toEqual(['myapp-dev']);
for (const [value, group] of [
[vars.qr, 'fake-group-fake-android-id'],
[vars.androidQR, 'fake-group-fake-android-id'],
[vars.iosQR, 'fake-group-fake-ios-id'],
]) {
const qr = new URL(value);
expect(qr.origin + qr.pathname).toBe('https://qr.expo.dev/development-client');
expect(qr.searchParams.get('appScheme')).toBe('myapp-dev');
expect(qr.searchParams.get('url')).toBe(`https://u.expo.dev/fake-project-id/group/${group}`);
}
});
});
describe(createSummary, () => {
describe('single update group', () => {
it('returns expected message for both platforms', () => {
+31
View File
@@ -1,10 +1,39 @@
import { getUpdateGroupQr } from '../eas';
describe(getUpdateGroupQr, () => {
it.each([
{ staging: '', host: 'u.expo.dev' },
{ staging: '1', host: 'staging-u.expo.dev' },
])('uses the native scheme and $host for development builds', ({ staging, host }) => {
const previous = process.env.EXPO_STAGING;
process.env.EXPO_STAGING = staging;
try {
const qr = new URL(
getUpdateGroupQr({
qrTarget: 'dev-build',
projectId: 'projectId',
updateGroupId: 'updateGroupId',
appSlug: 'appslug',
appScheme: 'com.example.app-dev',
})
);
expect(qr.origin + qr.pathname).toBe('https://qr.expo.dev/development-client');
expect(qr.searchParams.get('appScheme')).toBe('com.example.app-dev');
expect(qr.searchParams.get('url')).toBe(`https://${host}/projectId/group/updateGroupId`);
} finally {
if (previous === undefined) {
delete process.env.EXPO_STAGING;
} else {
process.env.EXPO_STAGING = previous;
}
}
});
it('returns url for expo-go', () => {
expect(
getUpdateGroupQr({
qrTarget: 'expo-go',
appScheme: 'myapp-dev',
projectId: 'projectId',
updateGroupId: 'updateGroupId',
appSlug: 'appslug',
@@ -19,6 +48,7 @@ describe(getUpdateGroupQr, () => {
projectId: 'projectId',
updateGroupId: 'updateGroupId',
appSlug: 'appslug',
appScheme: undefined,
})
).toBe(
'https://qr.expo.dev/eas-update?appScheme=appslug&projectId=projectId&groupId=updateGroupId'
@@ -32,6 +62,7 @@ describe(getUpdateGroupQr, () => {
projectId: 'projectId',
updateGroupId: 'updateGroupId',
appSlug: 'hello_world',
appScheme: undefined,
})
).toBe(
'https://qr.expo.dev/eas-update?appScheme=helloworld&projectId=projectId&groupId=updateGroupId'
+11 -3
View File
@@ -30,6 +30,7 @@ export function collectContinuousDeployFingerprintInput() {
branch: getInput('branch', { required: true }),
platform: platformInput,
environment: getInput('environment'),
appScheme: getInput('app-scheme') || undefined,
autoSubmitBuilds: getInput('auto-submit-builds') === 'true',
githubToken: getInput('github-token', { required: true }),
workingDirectory: getInput('working-directory', { required: true }),
@@ -256,11 +257,16 @@ function createSummaryForUpdatesAndBuilds({
projectId: string;
updates: EasUpdate[];
buildRunInfos: { androidBuildRunInfo?: BuildRunInfo; iosBuildRunInfo?: BuildRunInfo };
options: { qrTarget?: 'expo-go' | 'dev-build' | 'dev-client'; workingDirectory: string };
options: {
qrTarget?: 'expo-go' | 'dev-build' | 'dev-client';
workingDirectory: string;
appScheme: string | undefined;
};
}) {
const appSlug = config.slug;
const qrTarget = getQrTarget(options);
const appSchemes = getSchemesInOrderFromConfig(config) || [];
const appScheme = options.appScheme;
const appSchemes = appScheme ? [appScheme] : getSchemesInOrderFromConfig(config) || [];
const { androidBuildRunInfo, iosBuildRunInfo } = buildRunInfos;
@@ -274,7 +280,9 @@ function createSummaryForUpdatesAndBuilds({
? `[Update Permalink](${getUpdateGroupWebsite({ projectId, updateGroupId: update.group })})`
: 'n/a';
const getUpdateQRURL = (update: EasUpdate | undefined) =>
update ? getUpdateGroupQr({ projectId, updateGroupId: update.group, appSlug, qrTarget }) : null;
update
? getUpdateGroupQr({ projectId, updateGroupId: update.group, appSlug, appScheme, qrTarget })
: null;
const getBuildDetails = (buildRunInfo: BuildRunInfo) =>
getBuildLink(buildRunInfo.buildInfo) +
'<br />' +
+16 -6
View File
@@ -24,6 +24,7 @@ export function previewInput() {
return {
command: getInput('command'),
appScheme: getInput('app-scheme') || undefined,
shouldComment: !getInput('comment') || getBooleanInput('comment'),
commentId: getInput('comment-id') || MESSAGE_ID,
workingDirectory: getInput('working-directory'),
@@ -120,7 +121,8 @@ export function getVariables(
const android = updates.find(update => update.platform === 'android');
const ios = updates.find(update => update.platform === 'ios');
const appSchemes = getSchemesInOrderFromConfig(config) || [];
const appScheme = options.appScheme;
const appSchemes = appScheme ? [appScheme] : getSchemesInOrderFromConfig(config) || [];
const appSlug = config.slug;
const qrTarget = getQrTarget(options);
@@ -129,13 +131,19 @@ export function getVariables(
projectId,
projectName: config.name,
projectSlug: appSlug,
projectScheme: appSchemes[0] || '', // This is the longest scheme from one or more custom app schemes
projectSchemes: JSON.stringify(appSchemes), // These are all custom app schemes, in order from longest to shortest as JSON
projectScheme: appSchemes[0] || '', // The override, or the longest configured app scheme
projectSchemes: JSON.stringify(appSchemes), // The override, or configured app schemes in priority order as JSON
// Shared update properties
// Note, only use these properties when the update groups are identical
groupId: updates[0].group,
runtimeVersion: updates[0].runtimeVersion,
qr: getUpdateGroupQr({ projectId, updateGroupId: updates[0].group, appSlug, qrTarget }),
qr: getUpdateGroupQr({
projectId,
updateGroupId: updates[0].group,
appSlug,
appScheme,
qrTarget,
}),
link: getUpdateGroupWebsite({ projectId, updateGroupId: updates[0].group }),
// These are safe to access regardless of the update groups
branchName: updates[0].branch,
@@ -150,7 +158,7 @@ export function getVariables(
androidMessage: android?.message || '',
androidRuntimeVersion: android?.runtimeVersion || '',
androidQR: android
? getUpdateGroupQr({ projectId, updateGroupId: android.group, appSlug, qrTarget })
? getUpdateGroupQr({ projectId, updateGroupId: android.group, appSlug, appScheme, qrTarget })
: '',
androidLink: android ? getUpdateGroupWebsite({ projectId, updateGroupId: android.group }) : '',
// iOS update
@@ -160,7 +168,9 @@ export function getVariables(
iosManifestPermalink: ios?.manifestPermalink || '',
iosMessage: ios?.message || '',
iosRuntimeVersion: ios?.runtimeVersion || '',
iosQR: ios ? getUpdateGroupQr({ projectId, updateGroupId: ios.group, appSlug, qrTarget }) : '',
iosQR: ios
? getUpdateGroupQr({ projectId, updateGroupId: ios.group, appSlug, appScheme, qrTarget })
: '',
iosLink: ios ? getUpdateGroupWebsite({ projectId, updateGroupId: ios.group }) : '',
};
}
+12
View File
@@ -74,13 +74,25 @@ export function getUpdateGroupQr({
projectId,
updateGroupId,
appSlug,
appScheme,
qrTarget,
}: {
projectId: string;
updateGroupId: string;
appSlug: string;
appScheme: string | undefined;
qrTarget: 'expo-go' | 'dev-build';
}): string {
if (qrTarget === 'dev-build' && appScheme) {
// /eas-update treats appScheme as a slug and prefixes it with exp+.
// /development-client uses the native scheme verbatim instead.
const url = new URL('https://qr.expo.dev/development-client');
const host = process.env.EXPO_STAGING ? 'staging-u.expo.dev' : 'u.expo.dev';
url.searchParams.append('appScheme', appScheme);
url.searchParams.append('url', `https://${host}/${projectId}/group/${updateGroupId}`);
return url.toString();
}
const url = new URL('https://qr.expo.dev/eas-update');
if (qrTarget === 'dev-build') {