Skip to content

Commit 4f228e1

Browse files
Workaround actions checkout not pulling latest version
See actions/checkout#439
1 parent f25c6cf commit 4f228e1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ jobs:
5555
steps:
5656
- name: Check out repository
5757
uses: actions/checkout@v4
58+
with:
59+
ref: ${{ github.ref }}
5860

5961
- name: Run tests
6062
uses: ./.github/actions/test
@@ -67,14 +69,14 @@ jobs:
6769
name: Report coverage
6870
needs: test
6971
runs-on: ubuntu-latest
70-
env:
71-
from_fork: ${{ github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }}
72+
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
7273

7374
steps:
7475
- name: Check out repository
7576
uses: actions/checkout@v4
7677
with:
7778
fetch-depth: 0
79+
ref: ${{ github.ref }}
7880

7981
- name: Setup
8082
uses: ./.github/actions/setup
@@ -93,13 +95,11 @@ jobs:
9395
run: poetry run coverage combine coverage-*/.coverage
9496

9597
- name: Generate coverage report
96-
if: ${{ env.from_fork != 'true' }}
9798
run: |
9899
poetry run coverage xml -i
99100
sed -i "s/home\/runner\/work\/rate-control\/rate-control/github\/workspace/g" coverage.xml
100101
101102
- name: Report to SonarCloud
102-
if: ${{ env.from_fork != 'true' }}
103103
uses: sonarsource/sonarcloud-github-action@v2
104104
env:
105105
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
@@ -114,6 +114,7 @@ jobs:
114114
steps:
115115
- name: Check out repository
116116
uses: actions/checkout@v4
117+
ref: ${{ github.ref }}
117118

118119
- name: Setup
119120
uses: ./.github/actions/setup
@@ -141,6 +142,7 @@ jobs:
141142
uses: actions/checkout@v4
142143
with:
143144
token: ${{ secrets.PAT }}
145+
ref: ${{ github.ref }}
144146

145147
- name: Setup
146148
uses: ./.github/actions/setup

0 commit comments

Comments
 (0)