-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
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
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 |