From bf046f4fa19faf973b2868d3ef72943314b8888f Mon Sep 17 00:00:00 2001 From: lukewalczak Date: Fri, 10 Jan 2025 15:00:15 +0100 Subject: [PATCH] chore: update preview qr code --- .github/workflows/publish-each-pr.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-each-pr.yml b/.github/workflows/publish-each-pr.yml index 48e564327f..b8633e698e 100644 --- a/.github/workflows/publish-each-pr.yml +++ b/.github/workflows/publish-each-pr.yml @@ -53,6 +53,12 @@ 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 @@ -60,15 +66,17 @@ jobs: 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}) - + `; const comments = await github.rest.issues.listComments({