[DNM] test upload #33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Sentry PR iOS Upload (Size Analysis) | |
| on: | |
| pull_request: | |
| branches: [main] | |
| paths: [ios/**, .github/workflows/ios_sentry_upload_pr.yml] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./ios | |
| steps: | |
| - name: Checkout PR HEAD | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 2 | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Fetch base branch tip | |
| run: | | |
| git -c protocol.version=2 fetch --no-tags --prune --filter=blob:none origin \ | |
| "+refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}" | |
| git show -s --oneline "origin/${{ github.base_ref }}" | |
| - name: Compute merge-base (BASE_SHA) | |
| shell: bash | |
| run: | | |
| # Be strict about failures, but avoid -u (unbound var) because we build BASE_SHA progressively | |
| set -e -o pipefail | |
| BASE_REF="origin/${{ github.base_ref }}" | |
| echo "HEAD commit:" | |
| git show -s --oneline HEAD | |
| echo "Base ref:" | |
| git show -s --oneline "$BASE_REF" || { echo "Missing $BASE_REF"; exit 1; } | |
| # Try fork-point first; if it fails or is empty, fall back to plain merge-base | |
| BASE_SHA="" | |
| if BASE_SHA=$(git merge-base --fork-point "$BASE_REF" HEAD 2>/dev/null); then | |
| : | |
| fi | |
| if [[ -z "$BASE_SHA" ]]; then | |
| BASE_SHA=$(git merge-base HEAD "$BASE_REF") | |
| fi | |
| echo "BASE_SHA=$BASE_SHA" | |
| echo "BASE_SHA=$BASE_SHA" >> "$GITHUB_ENV" |