Skip to content

Commit bf046f4

Browse files
committed
chore: update preview qr code
1 parent 5f463b7 commit bf046f4

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/publish-each-pr.yml

+11-3
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,30 @@ jobs:
5353
working-directory: ./example
5454
id: expo
5555
run: echo "EXPO_CONFIG=$(npx expo config --json)" >> $GITHUB_OUTPUT
56+
57+
- name: Get branch info from EAS
58+
id: eas
59+
run: |
60+
branch = $(eas branch:view pr-${{ github.event.number }} --json --non-interactive)
61+
echo "BRANCH_INFO=$branch" >> $GITHUB_OUTPUT
5662
5763
- name: Comment on PR
5864
uses: actions/github-script@v7
5965
with:
6066
github-token: ${{ secrets.GITHUB_TOKEN }}
6167
script: |
6268
const config = JSON.parse('${{ steps.expo.outputs.EXPO_CONFIG }}');
69+
const branch = JSON.parse('${{ steps.eas.outputs.BRANCH_INFO }}';
70+
71+
const channel = 'pr-${{ github.event.number }}';
6372
6473
const { sdkVersion } = config;
6574
const { projectId } = config.extra.eas;
66-
67-
const channel = 'pr-${{ github.event.number }}';
75+
const { id } = branch;
6876
6977
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}`;
7078
const body = `The mobile version of example app from this branch is ready! You can [see it here.](${url})
71-
<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>
79+
<a href="${url}"><img src="https://qr.expo.dev/eas-update?projectId=${projectId}&runtimeVersion=exposdk:${sdkVersion}&branchId=${id}" height="200px" width="200px"></a>
7280
`;
7381
7482
const comments = await github.rest.issues.listComments({

0 commit comments

Comments
 (0)