@@ -8,7 +8,6 @@ permissions:
88 pull-requests : write
99
1010jobs :
11-
1211 tox :
1312 strategy :
1413 matrix :
1817 if : github.repository == 'NHSDigital/nhs-aws-helpers'
1918 steps :
2019 - name : checkout
21- uses : actions/checkout@v4
20+ uses : actions/checkout@v5
2221 with :
2322 fetch-depth : 0
2423
@@ -37,11 +36,14 @@ jobs:
3736 - name : merge into base_branch
3837 if : ${{ github.event_name == 'pull_request' }}
3938 run : |
40- echo base branch "${{ github.base_ref }} "
41- echo pr branch "${{ github.head_ref }} "
42- git checkout "${{ github.base_ref }} "
39+ echo base branch "$BASE_BRANCH "
40+ echo pr branch "$PR_BRANCH "
41+ git checkout "$BASE_BRANCH "
4342 git checkout -b "merging-${{ github.event.number }}"
4443 git merge --ff-only "${{ github.event.pull_request.head.sha }}"
44+ env :
45+ BASE_BRANCH : ${{ github.base_ref }}
46+ PR_BRANCH : ${{ github.head_ref }}
4547
4648 - name : setup python
4749 uses : actions/setup-python@v5
@@ -61,13 +63,12 @@ jobs:
6163 if : success() || failure()
6264 run : make down
6365
64-
6566 coverage :
6667 runs-on : ubuntu-latest
6768 if : github.repository == 'NHSDigital/nhs-aws-helpers'
6869 steps :
6970 - name : checkout
70- uses : actions/checkout@v4
71+ uses : actions/checkout@v5
7172 with :
7273 fetch-depth : 0
7374
@@ -89,11 +90,14 @@ jobs:
8990 - name : merge into base_branch
9091 if : ${{ github.event_name == 'pull_request' }}
9192 run : |
92- echo base branch "${{ github.base_ref }} "
93- echo pr branch "${{ github.head_ref }} "
94- git checkout "${{ github.base_ref }} "
93+ echo base branch "$BASE_BRANCH "
94+ echo pr branch "$PR_BRANCH "
95+ git checkout "$BASE_BRANCH "
9596 git checkout -b "merging-${{ github.event.number }}"
9697 git merge --ff-only "${{ github.event.pull_request.head.sha }}"
98+ env :
99+ BASE_BRANCH : ${{ github.base_ref }}
100+ PR_BRANCH : ${{ github.head_ref }}
97101
98102 - name : setup python
99103 uses : actions/setup-python@v5
@@ -133,7 +137,7 @@ jobs:
133137
134138 - name : code coverage report
135139 if : ${{ github.event_name == 'pull_request' }}
136- uses : orgoro/coverage@c65003f41276ea33fe3a3a5d53df8b340462e8fa
140+ uses : orgoro/coverage@7dbd48c7f7ed09df337ff40058340c85bc93cb3d
137141 with :
138142 coverageFile : reports/coverage.xml
139143 token : ${{ secrets.GITHUB_TOKEN }}
@@ -158,16 +162,16 @@ jobs:
158162 - name : run sonar scan
159163 if : success() || failure()
160164 run : |
161- PATH="$PWD/sonar-scanner/bin:$PATH"
162- if [[ "${{ github.event_name }}" == "pull_request" ]]; then
163- git checkout "${GITHUB_HEAD_REF}"
164- sonar-scanner -Dsonar.pullrequest.branch="{{ github.event.pull_request.head.sha }}" -Dsonar.pullrequest.base="{{ github.event.pull_request.base.sha }}" -Dsonar.pullrequest.key="${{ github.event.number }}"
165- else
166- sonar-scanner
167- fi
165+ PATH="$PWD/sonar-scanner/bin:$PATH"
166+ if [[ "${{ github.event_name }}" == "pull_request" ]]; then
167+ git checkout "${GITHUB_HEAD_REF}"
168+ sonar-scanner -Dsonar.pullrequest.branch="{{ github.event.pull_request.head.sha }}" -Dsonar.pullrequest.base="{{ github.event.pull_request.base.sha }}" -Dsonar.pullrequest.key="${{ github.event.number }}"
169+ else
170+ sonar-scanner
171+ fi
168172 env :
169- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
170- SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
173+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
174+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
171175
172176 - name : archive reports
173177 if : success() || failure()
@@ -192,7 +196,7 @@ jobs:
192196 if : github.repository == 'NHSDigital/nhs-aws-helpers'
193197 steps :
194198 - name : checkout
195- uses : actions/checkout@v4
199+ uses : actions/checkout@v5
196200 with :
197201 fetch-depth : 0
198202
@@ -206,11 +210,14 @@ jobs:
206210 - name : merge into base_branch
207211 if : ${{ github.event_name == 'pull_request' }}
208212 run : |
209- echo base branch "${{ github.base_ref }} "
210- echo pr branch "${{ github.head_ref }} "
211- git checkout "${{ github.base_ref }} "
213+ echo base branch "$BASE_BRANCH "
214+ echo pr branch "$PR_BRANCH "
215+ git checkout "$BASE_BRANCH "
212216 git checkout -b "merging-${{ github.event.number }}"
213217 git merge --ff-only "${{ github.event.pull_request.head.sha }}"
218+ env :
219+ BASE_BRANCH : ${{ github.base_ref }}
220+ PR_BRANCH : ${{ github.head_ref }}
214221
215222 - name : setup python
216223 uses : actions/setup-python@v5
@@ -262,7 +269,6 @@ jobs:
262269 echo "RELEASE_VERSION=$version" >> $GITHUB_ENV
263270 echo "${version}"
264271
265-
266272 publish :
267273 runs-on : ubuntu-latest
268274 if : github.repository == 'NHSDigital/nhs-aws-helpers' && github.actor != 'dependabot[bot]'
@@ -272,7 +278,7 @@ jobs:
272278 - tox
273279 steps :
274280 - name : checkout
275- uses : actions/checkout@v4
281+ uses : actions/checkout@v5
276282 with :
277283 fetch-depth : 0
278284
0 commit comments