Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⚙️ Chore: Update build-example-ios-for-pr Workflow
Browse files Browse the repository at this point in the history
dominicstop committed Dec 6, 2024
1 parent 00784af commit 98a2427
Showing 1 changed file with 27 additions and 12 deletions.
39 changes: 27 additions & 12 deletions .github/workflows/build-example-ios-for-pr.yml
Original file line number Diff line number Diff line change
@@ -17,14 +17,14 @@ jobs:
- name: Cancel previous runs
uses: styfle/[email protected]

- name: Get branch of PR
uses: xt0rted/pull-request-comment-branch@v1
id: comment-branch

- name: Checkout PR branch ${{ steps.comment-branch.outputs.head_ref }}
uses: actions/checkout@v3
with:
ref: ${{ steps.comment-branch.outputs.head_ref }}
- name: Checkout Pull Request - ${{ github.event.pull_request.title }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_URL="${{ github.event.issue.pull_request.url }}"
PR_NUM=${PR_URL##*/}
echo "Checking out from PR #$PR_NUM based on URL: $PR_URL"
gh pr checkout $PR_NUM
- name: Add workflow link as comment on PR
uses: actions/github-script@v6
@@ -33,7 +33,7 @@ jobs:
script: |
const name = '${{ github.workflow }}';
const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
const body = `Run GH Workflow: ${name}`;
const body = `Run GH Workflow: ${name}\n${url}`;
await github.rest.issues.createComment({
issue_number: context.issue.number,
@@ -49,9 +49,6 @@ jobs:

- name: Check Xcode version
run: /usr/bin/xcodebuild -version

- name: Checkout repo from main branch
uses: actions/checkout@v4

- name: Install Apple certificate and provisioning profile
env:
@@ -130,3 +127,21 @@ jobs:
- name: 4/4 - Build example (paper, dynamic frameworks)
run: yarn run build:ios

# Builds completed...

- name: Add workflow result as comment on PR
uses: actions/github-script@v6
if: always()
with:
script: |
const name = '${{ github.workflow }}';
const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
const success = '${{ job.status }}' === 'success';
const body = `${name}: ${success ? 'succeeded ✅' : 'failed ❌'}\n${url}`;
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
})

0 comments on commit 98a2427

Please sign in to comment.