Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable to track the commit to generate page(s) in Actions from the corresponding PR page #348

Merged
merged 1 commit into from
Feb 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,20 @@ jobs:
cd ./docs
bundle install

- name: 📝 Extract PR number from last commit
run: |
COMMIT_MESSAGE=$(git show -s --format=%s HEAD)
PR_NUMBER=$(echo "$COMMIT_MESSAGE" | sed -nE 's/^Merge pull request #([0-9]+).*/\1/p')

if [ -n "$PR_NUMBER" ]; then
echo "PR_NUMBER=#$PR_NUMBER" >> $GITHUB_ENV; else
echo "PR_NUMBER=" >> $GITHUB_ENV
fi

- name: 🤖 Generate page(s) by README
env:
TZ: 'Asia/Tokyo'
PR_NUMBER: ${{ env.PR_NUMBER }}
run: |
cd ./docs
bundle exec rake upsert_data_by_readme
Expand All @@ -74,7 +85,7 @@ jobs:
git config --global user.email "[email protected]"
git checkout main
git add en ja
git commit -m '🤖 Generate page(s) by README'
git commit -m "🤖 Generate page(s) by README $PR_NUMBER"
git push origin main
fi

Expand Down