Skip to content

Commit

Permalink
Add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
NY0510 committed Jan 5, 2024
1 parent 2ecc484 commit bf81c51
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/IndexNow.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

commit_message=$(git log -1 --pretty=format:"%s")

# 커밋 메시지가 'new post: '로 시작할 때만
if [[ $commit_message == "new post: "* ]]; then
title=${commit_message#"new post: "} # 'new post: ' 부분을 제거하여 제목만 추출

curl -X POST -H "Content-Type: application/json" \
-d '{
"url": "https://blog.ny64.kr/posts/'"$title"'",
"type": "URL_UPDATED"
}' \
"https://indexing.googleapis.com/v3/urlNotifications:publish?key=YOUR_API_KEY"
fi
15 changes: 15 additions & 0 deletions .github/indexNow.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

commit_message=$(git log -1 --pretty=format:"%s")

# 커밋 메시지가 'new post: '로 시작할 때만
if [[ $commit_message == "new post: "* ]]; then
title=${commit_message#"new post: "} # 'new post: ' 부분을 제거하여 제목만 추출

curl -X POST -H "Content-Type: application/json" \
-d '{
"url": "https://blog.ny64.kr/posts/'"$title"'",
"type": "URL_UPDATED"
}' \
"https://indexing.googleapis.com/v3/urlNotifications:publish?key=YOUR_API_KEY"
fi

0 comments on commit bf81c51

Please sign in to comment.