Skip to content

Commit

Permalink
Make checkout ref conditional based on PR or Nightly.
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonpage committed Jan 30, 2025
1 parent 1d9dfd6 commit 2941b43
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
# We need a sufficient depth or Danger will occasionally run into issues checking which files were modified.
fetch-depth: 100
# This is dangerous without the member check
ref: ${{ github.head_ref }}
ref: ${{ github.event.pull_request.head.sha }}
- name: Install Dependencies
run: |
npm install [email protected]
Expand Down Expand Up @@ -102,4 +102,5 @@ jobs:
uses: ./.github/workflows/reusable-workflow.yaml
with:
lib: ${{ matrix.lib }}
is_pr: true
secrets: inherit
11 changes: 9 additions & 2 deletions .github/workflows/reusable-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ on:
default: macos-15
required: false
type: string
is_pr:
type: boolean
default: false

jobs:
test-ios:
Expand All @@ -24,10 +27,14 @@ jobs:
BUNDLE_GEMFILE: ${{ github.workspace }}/.github/DangerFiles/Gemfile
steps:
- uses: actions/checkout@v4
# We need a sufficient depth or Danger will occasionally run into issues
# checking which files were modified.
if: ${{ inputs.is_pr }}
with:
# We need a sufficient depth or Danger will occasionally run into issues checking which files were modified.
fetch-depth: 100
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@v4
if: ${{ ! inputs.is_pr }}
with:
ref: ${{ github.head_ref }}
- name: Install Dependencies
env:
Expand Down

0 comments on commit 2941b43

Please sign in to comment.