Skip to content

Commit b665fac

Browse files
authored
replaced remote base with fetch head (#217)
1 parent 5ea8b33 commit b665fac

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

.github/workflows/build_test.yaml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,14 @@ jobs:
112112
if: github.event_name == 'pull_request_target'
113113
run: |
114114
git config --global --add safe.directory $GITHUB_WORKSPACE
115-
116115
git config user.name "github-actions"
117116
git config user.email "github-actions@github.com"
118117
119-
git remote add base https://github.com/${{ github.repository }}.git
120-
git fetch base ${{ github.event.pull_request.base.ref }}
118+
echo "Fetching latest main from base repository..."
119+
git fetch https://github.com/${{ github.repository }}.git ${{ github.event.pull_request.base.ref }}
121120
122121
echo "Merging latest ${{ github.event.pull_request.base.ref }} into PR branch..."
123-
git merge base/${{ github.event.pull_request.base.ref }}
122+
git merge FETCH_HEAD
124123
- name: install requirements
125124
run: |
126125
bash -x .github/scripts/install_requirements.sh
@@ -173,15 +172,14 @@ jobs:
173172
if: github.event_name == 'pull_request_target'
174173
run: |
175174
git config --global --add safe.directory $GITHUB_WORKSPACE
176-
177175
git config user.name "github-actions"
178176
git config user.email "github-actions@github.com"
179177
180-
git remote add base https://github.com/${{ github.repository }}.git
181-
git fetch base ${{ github.event.pull_request.base.ref }}
178+
echo "Fetching latest main from base repository..."
179+
git fetch https://github.com/${{ github.repository }}.git ${{ github.event.pull_request.base.ref }}
182180
183181
echo "Merging latest ${{ github.event.pull_request.base.ref }} into PR branch..."
184-
git merge base/${{ github.event.pull_request.base.ref }}
182+
git merge FETCH_HEAD
185183
- name: install requirements
186184
run: |
187185
bash -x .github/scripts/install_requirements.sh

0 commit comments

Comments
 (0)