docs: Add daily report 2024/08/16 #22
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check Daily Reports | |
on: | |
pull_request: | |
paths: | |
- 'reports/**/*.md' | |
jobs: | |
validate-reports: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Validate report format | |
run: | | |
for file in $(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }}); do | |
if [[ $file == reports/**/*.md ]]; then | |
echo "Checking $file" | |
if ! grep -q "^### 今週の目標勉強時間" "$file"; then | |
echo "Error: Missing '### 今週の目標勉強時間' in $file" | |
exit 1 | |
fi | |
if ! grep -q "^### 今日の勉強時間とデイリーハイライト" "$file"; then | |
echo "Error: Missing '### 今日の勉強時間' in $file" | |
exit 1 | |
fi | |
if ! grep -q "^## 学習内容" "$file"; then | |
echo "Error: Missing '## 学習内容' in $file" | |
exit 1 | |
fi | |
if ! grep -q "^### 学習メモ" "$file"; then | |
echo "Error: Missing '## 学習メモ' in $file" | |
exit 1 | |
fi | |
if ! grep -q "^## 参考記事・URL" "$file"; then | |
echo "Error: Missing '## 参考記事・URL' in $file" | |
exit 1 | |
fi | |
fi | |
done |