Skip to content
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
19 changes: 18 additions & 1 deletion bin/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,22 @@ git config user.email "[email protected]"
git add -f README.md
git add -f instances.csv

git commit --quiet -m "Deploy from actions"
# マージコミットメッセージから PR番号を抽出
PR_NUMBER=$(git log -1 --pretty=%B | grep -oE '#[0-9]+' | head -1 || echo "")

# コミットメッセージを動的に生成
if [ -n "$PR_NUMBER" ]; then
COMMIT_MSG="Deploy from actions (PR $PR_NUMBER)"
else
COMMIT_MSG="Deploy from actions"
fi

# 追加されたサーバー情報を取得(オプション)
NEW_SERVERS=$(git diff --cached instances.csv | grep '^+' | grep -v '^+++' | cut -d',' -f1 | sed 's/^+//' | head -3 | paste -sd ', ' || echo "")

if [ -n "$NEW_SERVERS" ]; then
COMMIT_MSG="$COMMIT_MSG - Added: $NEW_SERVERS"
fi

git commit --quiet -m "$COMMIT_MSG"
git push --force --quiet "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" master:gh-pages