File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9696 docker rm blog-${{ steps.color.outputs.current }} || true
9797 docker rmi blog:${{ steps.color.outputs.current }} || true
9898
99- - name : Notify subscribers on new post
100- if : success()
101- env :
102- NOTIFY_API_KEY : ${{ secrets.NOTIFY_API_KEY }}
103- run : |
104- echo "=== DEBUG ==="
105- echo "KEY_LENGTH=${#NOTIFY_API_KEY}"
106- NEW_POST=$(git log --diff-filter=A --name-only --format= HEAD~5..HEAD -- 'content/posts/*.md' 'content/posts/**/*.md' 2>/dev/null | grep '\.md$' | head -1 || true)
107- echo "NEW_POST=$NEW_POST"
108- if [ -n "$NEW_POST" ] && [ -f "$NEW_POST" ]; then
109- TITLE=$(grep -m1 '^title:' "$NEW_POST" 2>/dev/null | sed 's/^title:[[:space:]]*//' | tr -d '"' || basename "$NEW_POST" .md)
110- REL=${NEW_POST#content/posts/}
111- SLUG=${REL%.md}
112- echo "SLUG=$SLUG"
113- PAYLOAD=$(jq -n --arg title "$TITLE" --arg slug "$SLUG" --arg url "https://koala.ai.kr/posts/$SLUG" --arg key "$NOTIFY_API_KEY" \
114- '{"title":$title,"slug":$slug,"url":$url,"api_key":$key}')
115- RESULT=$(curl -s -X POST https://api.koala.ai.kr/subscribe/notify \
116- -H 'Content-Type: application/json' \
117- -d "$PAYLOAD")
118- echo "RESULT=$RESULT"
119- else
120- echo "새 글 없음 또는 파일 미존재"
121- fi
122-
12399 - name : Notify self-healing
124100 if : failure()
125101 run : |
You can’t perform that action at this time.
0 commit comments