Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
Atotti committed Nov 14, 2023
1 parent 2f52959 commit 79dd34c
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/Update-progress.yml
Original file line number Diff line number Diff line change
@@ -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 "[email protected]"
git add progress.md
git diff-index --quiet HEAD || git commit -m "Update progress bar"
git push

0 comments on commit 79dd34c

Please sign in to comment.