Skip to content

Commit

Permalink
Merge pull request #348 from remote-jp/extract-pr-number-if-exists-in…
Browse files Browse the repository at this point in the history
…-actions

Enable to track the commit to generate page(s) in Actions from the corresponding PR page
  • Loading branch information
yasulab authored Feb 18, 2025
2 parents 0230b6d + 2ed5bc1 commit a30e866
Showing 1 changed file with 12 additions and 1 deletion.
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

0 comments on commit a30e866

Please sign in to comment.