Skip to content

Commit

Permalink
chore: update preview qr code
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewalczak committed Jan 10, 2025
1 parent 5f463b7 commit bf046f4
Showing 1 changed file with 11 additions and 3 deletions.
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,22 +53,30 @@ jobs:
working-directory: ./example
id: expo
run: echo "EXPO_CONFIG=$(npx expo config --json)" >> $GITHUB_OUTPUT

- name: Get branch info from EAS
id: eas
run: |
branch = $(eas branch:view pr-${{ github.event.number }} --json --non-interactive)
echo "BRANCH_INFO=$branch" >> $GITHUB_OUTPUT
- name: Comment on PR
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const config = JSON.parse('${{ steps.expo.outputs.EXPO_CONFIG }}');
const branch = JSON.parse('${{ steps.eas.outputs.BRANCH_INFO }}';
const channel = 'pr-${{ github.event.number }}';
const { sdkVersion } = config;
const { projectId } = config.extra.eas;
const channel = 'pr-${{ github.event.number }}';
const { id } = branch;
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=${id}" height="200px" width="200px"></a>
`;
const comments = await github.rest.issues.listComments({
Expand Down

0 comments on commit bf046f4

Please sign in to comment.