Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update preview qr code #4599

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .github/workflows/publish-each-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ jobs:
working-directory: ./example
id: expo
run: echo "EXPO_CONFIG=$(npx expo config --json)" >> $GITHUB_OUTPUT

- name: Get branch info from EAS
working-directory: ./example
id: eas
run: |
branch_id=$(eas branch:view pr-${{ github.event.number }} --json --non-interactive | jq -r '.id')
echo "BRANCH_ID=$branch_id" >> $GITHUB_OUTPUT

- name: Comment on PR
uses: actions/github-script@v7
Expand All @@ -61,14 +68,15 @@ jobs:
script: |
const config = JSON.parse('${{ steps.expo.outputs.EXPO_CONFIG }}');

const branchId = '${{ steps.eas.outputs.BRANCH_ID }}';
const channel = 'pr-${{ github.event.number }}';

const { sdkVersion } = config;
const { projectId } = config.extra.eas;

const channel = 'pr-${{ github.event.number }}';

const url = `https://expo.dev/@react-native-paper/react-native-paper-example?serviceType=eas&distribution=expo-go&scheme=exp+react-native-paper-example&channel=${channel}&sdkVersion=${sdkVersion}`;
const body = `The mobile version of example app from this branch is ready! You can [see it here.](${url})
<a href="${url}"><img src="https://qr.expo.dev/eas-update?appScheme=exp&projectId=${projectId}&channel=${channel}&runtimeVersion=exposdk:${sdkVersion}&host=u.expo.dev" height="200px" width="200px"></a>
<a href="${url}"><img src="https://qr.expo.dev/eas-update?projectId=${projectId}&runtimeVersion=exposdk:${sdkVersion}&branchId=${branchId}" height="200px" width="200px"></a>
`;

const comments = await github.rest.issues.listComments({
Expand Down
Loading