Skip to content

Commit 8394b22

Browse files
Do not fetch tags
1 parent 5a48b90 commit 8394b22

File tree

1 file changed

+36
-3
lines changed

1 file changed

+36
-3
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,18 @@ jobs:
1818

1919
steps:
2020
- name: Checkout
21-
uses: actions/checkout@v4
21+
uses: actions/checkout@v5
22+
with:
23+
fetch-depth: 1
24+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
25+
26+
- name: Use local branch
27+
shell: bash
28+
run: |
29+
BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}")
30+
git branch -D $BRANCH 2>/dev/null || true
31+
git branch $BRANCH HEAD
32+
git checkout $BRANCH
2233
2334
- name: Install PHP
2435
uses: shivammathur/setup-php@v2
@@ -38,7 +49,18 @@ jobs:
3849

3950
steps:
4051
- name: Checkout
41-
uses: actions/checkout@v4
52+
uses: actions/checkout@v5
53+
with:
54+
fetch-depth: 1
55+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
56+
57+
- name: Use local branch
58+
shell: bash
59+
run: |
60+
BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}")
61+
git branch -D $BRANCH 2>/dev/null || true
62+
git branch $BRANCH HEAD
63+
git checkout $BRANCH
4264
4365
- name: Install PHP
4466
uses: shivammathur/setup-php@v2
@@ -87,7 +109,18 @@ jobs:
87109
run: git config --global core.autocrlf false
88110

89111
- name: Checkout
90-
uses: actions/checkout@v4
112+
uses: actions/checkout@v5
113+
with:
114+
fetch-depth: 1
115+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
116+
117+
- name: Use local branch
118+
shell: bash
119+
run: |
120+
BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}")
121+
git branch -D $BRANCH 2>/dev/null || true
122+
git branch $BRANCH HEAD
123+
git checkout $BRANCH
91124
92125
- name: Install PHP with extensions
93126
uses: shivammathur/setup-php@v2

0 commit comments

Comments
 (0)