Skip to content

Commit

Permalink
add checked file
Browse files Browse the repository at this point in the history
  • Loading branch information
matsuoshi committed Jan 21, 2024
1 parent f5867cd commit 9172ec4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -30,13 +30,15 @@ jobs:
run: composer build

- name: commit and push
env:
TZ: 'Asia/Tokyo'
run: |
git add -N .
if ! git diff --exit-code --quiet
then
git config user.email "[email protected]"
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
8 changes: 8 additions & 0 deletions app/holidaysJP.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public function generate()
foreach ($yearly as $year => $ary) {
$this->generate_api_file($ary, $year);
}

$this->updateCheckedFile();
}

/**
Expand Down Expand Up @@ -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'));
}
}
1 change: 1 addition & 0 deletions docs/v1/checked_at.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2024-01-22 00:17:56

0 comments on commit 9172ec4

Please sign in to comment.