Skip to content

Commit 2093efb

Browse files
committed
ci: cleanup
1 parent 58f3267 commit 2093efb

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

.github/workflows/pull_request.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,22 @@ jobs:
1515
with:
1616
submodules: false
1717

18-
- name: Fetch Base Branch
18+
- name: Set Base and Head Refs
19+
run: |
20+
BASE_REF="${{ github.event.pull_request.base.sha }}"
21+
HEAD_REF="${{ github.event.pull_request.head.sha }}"
22+
BASE_REMOTE="${{github.event.pull_request.base.repo.clone_url}}"
23+
HEAD_REMOTE="${{github.event.pull_request.head.repo.clone_url}}"
24+
25+
echo "BASE_REF=$BASE_REF" >> $GITHUB_ENV
26+
echo "HEAD_REF=$HEAD_REF" >> $GITHUB_ENV
27+
echo "BASE_REMOTE=$BASE_REMOTE" >> $GITHUB_ENV
28+
echo "HEAD_REMOTE=$HEAD_REMOTE" >> $GITHUB_ENV
29+
30+
- name: Fetch Branches
1931
run: |
20-
# Fetch all history for the base branch and PR head
21-
git fetch origin ${{ github.base_ref }} --depth=1
22-
git fetch origin ${{ github.head_ref }} --depth=1
32+
git fetch ${BASE_REMOTE} ${BASE_REF}
33+
git fetch ${HEAD_REMOTE} ${HEAD_REF}
2334
2435
- name: Detect Added Submodules
2536
run: |
@@ -45,6 +56,7 @@ jobs:
4556
args: --check addons
4657

4758
metadata:
59+
name: Fetch metadata
4860
runs-on: ubuntu-latest
4961
permissions:
5062
contents: write
@@ -66,9 +78,8 @@ jobs:
6678
echo "BASE_REMOTE=$BASE_REMOTE" >> $GITHUB_ENV
6779
echo "HEAD_REMOTE=$HEAD_REMOTE" >> $GITHUB_ENV
6880
69-
- name: Fetch Base Branch
81+
- name: Fetch Branches
7082
run: |
71-
# Fetch all history for the base branch and PR head
7283
git fetch ${BASE_REMOTE} ${BASE_REF}
7384
git fetch ${HEAD_REMOTE} ${HEAD_REF}
7485

0 commit comments

Comments
 (0)