Compare commits

...

5 Commits
2.4.0 ... 2

Author SHA1 Message Date
Maxime Rainville ee49a440fb
Merge pull request #86 from creative-commoners/pulls/2/dispatch-ci
MNT Use gha-dispatch-ci
2023-03-23 12:16:16 +13:00
Steve Boyd cb34aa869f MNT Use gha-dispatch-ci 2023-03-21 12:19:24 +13:00
Steve Boyd 5c8070044c Merge branch '2.4' into 2 2023-02-02 16:20:55 +13:00
Maxime Rainville 8e3f71afb7
Merge pull request #85 from creative-commoners/pulls/2.4/null-state
FIX Handle invalid json data
2023-01-26 13:15:33 +13:00
Steve Boyd fe5e87598f FIX Handle invalid json data 2023-01-24 14:38:01 +13:00
3 changed files with 20 additions and 6 deletions

View File

@ -4,13 +4,8 @@ on:
push:
pull_request:
workflow_dispatch:
# Every Monday at 2:30pm UTC
schedule:
- cron: '30 14 * * 1'
jobs:
ci:
name: CI
# Only run cron on the silverstripe account
if: (github.event_name == 'schedule' && github.repository_owner == 'silverstripe') || (github.event_name != 'schedule')
uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1

16
.github/workflows/dispatch-ci.yml vendored Normal file
View File

@ -0,0 +1,16 @@
name: Dispatch CI
on:
# At 2:30 PM UTC, only on Monday and Tuesday
schedule:
- cron: '30 14 * * 1,2'
jobs:
dispatch-ci:
name: Dispatch CI
# Only run cron on the silverstripe account
if: (github.event_name == 'schedule' && github.repository_owner == 'silverstripe') || (github.event_name != 'schedule')
runs-on: ubuntu-latest
steps:
- name: Dispatch CI
uses: silverstripe/gha-dispatch-ci@v1

View File

@ -529,7 +529,10 @@ class TestSessionEnvironment
public function getState()
{
$path = Director::getAbsFile($this->getFilePath());
return (file_exists($path ?? '')) ? json_decode(file_get_contents($path)) : new stdClass;
if (file_exists($path ?? '')) {
return json_decode(file_get_contents($path)) ?: new stdClass;
}
return new stdClass;
}
/**