Skip to content

Commit 1c9e1df

Browse files
authored
Refactor build workflow to use GITHUB_BASE_REF
Removed the step to determine the default branch and updated git fetch and infection commands to use GITHUB_BASE_REF.
1 parent 53c1301 commit 1c9e1df

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,6 @@ jobs:
290290
> infection.json5
291291
jq . infection.json5
292292
293-
- name: "Determine default branch"
294-
id: default-branch
295-
run: |
296-
echo "name=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')" >> "$GITHUB_OUTPUT"
297-
298293
- name: "Restore result cache"
299294
uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
300295
with:
@@ -305,9 +300,9 @@ jobs:
305300
306301
- name: "Run infection"
307302
run: |
308-
git fetch --depth=1 origin ${{ steps.default-branch.outputs.name }}
303+
git fetch --depth=1 origin "$GITHUB_BASE_REF"
309304
infection \
310-
--git-diff-base=origin/${{ steps.default-branch.outputs.name }} \
305+
--git-diff-base=origin/"$GITHUB_BASE_REF" \
311306
--git-diff-lines \
312307
--ignore-msi-with-no-mutations \
313308
--min-msi=100 \

0 commit comments

Comments
 (0)