diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b82dfa9..2a9a6fc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,7 @@ on: push: branches: [ master, v1.1, build-test ] schedule: - - cron: '19 19 */3 * *' + - cron: '5 15 1,15,31 * *' jobs: build: @@ -30,6 +30,8 @@ jobs: run: composer build - name: commit and push + env: + TZ: 'Asia/Tokyo' run: | git add -N . if ! git diff --exit-code --quiet @@ -37,6 +39,6 @@ jobs: git config user.email "matsuoshi@gmail.com" git config user.name "from GitHub Actions" git add --all - git commit -m "update holidays" + git commit -m "$(date +'%Y-%m-%d %H:%M:%S')" git push fi diff --git a/app/holidaysJP.php b/app/holidaysJP.php index e4c8328..ade9420 100644 --- a/app/holidaysJP.php +++ b/app/holidaysJP.php @@ -48,6 +48,8 @@ public function generate() foreach ($yearly as $year => $ary) { $this->generate_api_file($ary, $year); } + + $this->updateCheckedFile(); } /** @@ -165,4 +167,10 @@ protected function output_csv_file($filename, $data) } fclose($fp); } + + protected function updateCheckedFile() + { + $checkedFile = self::DIST . '/checked_at.txt'; + file_put_contents($checkedFile, date('Y-m-d H:i:s')); + } } diff --git a/docs/v1/checked_at.txt b/docs/v1/checked_at.txt new file mode 100644 index 0000000..49e7c34 --- /dev/null +++ b/docs/v1/checked_at.txt @@ -0,0 +1 @@ +2024-01-22 00:17:56 \ No newline at end of file