Skip to content

Commit

Permalink
fix(preview): use proper comment output variables
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric committed Feb 18, 2023
1 parent 49544e3 commit 9d6631d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ jobs:
echo $(jq 'del(.expo.runtimeVersion)' app.json) > app.json
echo $(jq '.expo.android.runtimeVersion.policy = "sdkVersion"' app.json) > app.json
echo $(jq '.expo.ios.runtimeVersion.policy = "appVersion"' app.json) > app.json
echo $(jq '.expo.scheme = "expogithubaction"' app.json) > app.json
- name: 🚀 Create preview (multi QR)
if: ${{ env.hasAuth == 'true' }}
Expand Down
16 changes: 12 additions & 4 deletions build/preview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23903,8 +23903,8 @@ async function previewAction(input = previewInput()) {
for (const [name, value] of Object.entries(variables)) {
(0,core.setOutput)(name, value);
}
(0,core.setOutput)('messageId', messageId);
(0,core.setOutput)('messageBody', messageBody);
(0,core.setOutput)('commentId', messageId);
(0,core.setOutput)('comment', messageBody);
}
/**
* Validate and sanitize the command that creates the update.
Expand Down Expand Up @@ -23982,7 +23982,11 @@ function createSummary(updates, vars) {
}
function createSingleQrSummary(updates, vars) {
const platformName = `Platform${updates.length === 1 ? '' : 's'}`;
const platformValue = updates.map(update => `**${update.platform}**`).join(', ');
const platformValue = updates
.map(update => update.platform)
.sort((a, b) => a.localeCompare(b))
.map(platform => `**${platform}**`)
.join(', ');
return `🚀 Expo preview is ready!

- Project → **${vars.projectSlug}**
Expand All @@ -23997,7 +24001,11 @@ function createSingleQrSummary(updates, vars) {
function createMultipleQrSummary(updates, vars) {
const createTableHeader = (segments) => segments.filter(Boolean).join(' <br /> ');
const platformName = `Platform${updates.length === 1 ? '' : 's'}`;
const platformValue = updates.map(update => `**${update.platform}**`).join(', ');
const platformValue = updates
.map(update => update.platform)
.sort((a, b) => a.localeCompare(b))
.map(platform => `**${platform}**`)
.join(', ');
const androidHeader = createTableHeader([
'Android',
vars.androidId && vars.androidRuntimeVersion ? `_(${vars.androidRuntimeVersion})_` : '',
Expand Down
16 changes: 12 additions & 4 deletions src/actions/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ export async function previewAction(input = previewInput()) {
setOutput(name, value);
}

setOutput('messageId', messageId);
setOutput('messageBody', messageBody);
setOutput('commentId', messageId);
setOutput('comment', messageBody);
}

/**
Expand Down Expand Up @@ -153,7 +153,11 @@ export function createSummary(updates: EasUpdate[], vars: ReturnType<typeof getV

function createSingleQrSummary(updates: EasUpdate[], vars: ReturnType<typeof getVariables>) {
const platformName = `Platform${updates.length === 1 ? '' : 's'}`;
const platformValue = updates.map(update => `**${update.platform}**`).join(', ');
const platformValue = updates
.map(update => update.platform)
.sort((a, b) => a.localeCompare(b))
.map(platform => `**${platform}**`)
.join(', ');

return `🚀 Expo preview is ready!
Expand All @@ -171,7 +175,11 @@ function createMultipleQrSummary(updates: EasUpdate[], vars: ReturnType<typeof g
const createTableHeader = (segments: string[]) => segments.filter(Boolean).join(' <br /> ');

const platformName = `Platform${updates.length === 1 ? '' : 's'}`;
const platformValue = updates.map(update => `**${update.platform}**`).join(', ');
const platformValue = updates
.map(update => update.platform)
.sort((a, b) => a.localeCompare(b))
.map(platform => `**${platform}**`)
.join(', ');

const androidHeader = createTableHeader([
'Android',
Expand Down

0 comments on commit 9d6631d

Please sign in to comment.