Skip to content

Token reduction + routing reliability, provider/cost fixes, native AB… #30

Token reduction + routing reliability, provider/cost fixes, native AB…

Token reduction + routing reliability, provider/cost fixes, native AB… #30

Workflow file for this run

name: Notify IndexNow on Docs Update
on:
push:
branches:
- main
paths:
- 'docs/**'
jobs:
notify-indexnow:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Notify IndexNow
env:
INDEXNOW_KEY: ${{ secrets.INDEX_NOW }}
run: |
echo "Notifying IndexNow about updated docs..."
# Host
HOST="vishalveerareddy123.github.io"
# Secret key pulled from GitHub
KEY="$INDEXNOW_KEY"
# Public key location URL
KEY_LOCATION="https://$HOST/Lynkr/${KEY}.txt"
# Prepare JSON payload
URLS_JSON=$(cat <<EOF
{
"host": "$HOST",
"key": "$KEY",
"keyLocation": "$KEY_LOCATION",
"urlList": [
"https://$HOST/Lynkr/",
"https://$HOST/Lynkr/sitemap.xml"
]
}
EOF
)
echo "Payload:"
echo "$URLS_JSON"
HTTP_CODE=$(curl -s -o /tmp/indexnow_response.txt -w "%{http_code}" \
-X POST "https://www.bing.com/indexnow" \
-H "Content-Type: application/json; charset=utf-8" \
-d "$URLS_JSON")
echo "IndexNow response HTTP code: $HTTP_CODE"
echo "IndexNow response body:"
cat /tmp/indexnow_response.txt
if [ "$HTTP_CODE" -ge 400 ]; then
echo "IndexNow request failed"
exit 1
fi