File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -176,22 +176,26 @@ jobs:
176176
177177 - name : Determine retention days
178178 id : determine-retention-days
179- run : |
180- if [ "${GITHUB_REF}" = "refs/heads/main" ] || [[ "${GITHUB_REF}" == refs/tags/* ]]; then
181- echo "retention_days=90" >> $GITHUB_OUTPUT
182- else
183- echo "retention_days=3" >> $GITHUB_OUTPUT
184- fi
179+ run : >-
180+ echo "retention_days=${RETENTION_DAYS}"
181+ >> "${GITHUB_OUTPUT}"
185182 env :
186- GITHUB_REF : ${{ github.ref }}
183+ RETENTION_DAYS : >-
184+ ${{
185+ (
186+ github.ref_type == 'tag'
187+ && github.ref_name == github.event.repository.default_branch
188+ )
189+ && 90
190+ || 3
191+ }}
187192
188193 - name : Upload combined .coverage file
189194 uses : actions/upload-artifact@v4
190195 with :
191196 name : coverage-file
192197 path : .coverage
193198 retention-days : ${{ steps.determine-retention-days.outputs.retention_days }}
194- include-hidden-files : true
195199
196200 - name : Upload HTML coverage report
197201 uses : actions/upload-artifact@v4
Original file line number Diff line number Diff line change @@ -728,15 +728,15 @@ class Test_django_db_blocker:
728728 def test_block_manually (self , django_db_blocker : DjangoDbBlocker ) -> None :
729729 try :
730730 django_db_blocker .block ()
731- with pytest .raises (RuntimeError ):
731+ with pytest .raises (RuntimeError , match = "^Database access not allowed," ):
732732 Item .objects .exists ()
733733 finally :
734734 django_db_blocker .restore ()
735735
736736 @pytest .mark .django_db
737737 def test_block_with_block (self , django_db_blocker : DjangoDbBlocker ) -> None :
738738 with django_db_blocker .block ():
739- with pytest .raises (RuntimeError ):
739+ with pytest .raises (RuntimeError , match = "^Database access not allowed," ):
740740 Item .objects .exists ()
741741
742742 def test_unblock_manually (self , django_db_blocker : DjangoDbBlocker ) -> None :
You can’t perform that action at this time.
0 commit comments