From 79dd34c0bd54e217ff282aa175843ff57ec1609a Mon Sep 17 00:00:00 2001
From: Ayuto1215 <Ayuto1215@outlook.com>
Date: Tue, 14 Nov 2023 09:27:03 +0900
Subject: [PATCH] a

---
 .github/workflows/Update-progress.yml | 45 +++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 .github/workflows/Update-progress.yml

diff --git a/.github/workflows/Update-progress.yml b/.github/workflows/Update-progress.yml
new file mode 100644
index 0000000..05644ff
--- /dev/null
+++ b/.github/workflows/Update-progress.yml
@@ -0,0 +1,45 @@
+name: Update Progress Bar
+
+on:
+  push:
+    branches:
+      - '**'
+
+jobs:
+  update-progress-bar:
+    runs-on: ubuntu-latest
+    env:
+      BRANCH_NAME: ${{ github.ref_name }}
+      CHAPTER_NAME: 'chapter01'  # ここを任意のchapter名に更新します
+
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v2
+
+      - name: Set up Python
+        uses: actions/setup-python@v2
+        with:
+          python-version: '3.x'
+
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade pip
+          python -m pip install -r requirements.txt
+
+      - name: Calculate progress
+        run: |
+          echo "PROGRESS=$(python calculate_progress.py $BRANCH_NAME $CHAPTER_NAME)" >> $GITHUB_ENV
+
+      - name: Generate progress bar
+        run: |
+          echo "# Progress" > progress.md
+          echo "" >> progress.md
+          echo "![](https://progress-bar.dev/$PROGRESS)" >> progress.md
+
+      - name: Commit progress bar
+        run: |
+          git config user.name "GitHub Actions"
+          git config user.email "actions@github.com"
+          git add progress.md
+          git diff-index --quiet HEAD || git commit -m "Update progress bar"
+          git push
\ No newline at end of file