Files
fastapi/scripts/trigger-docs-preview.sh
Sebastián Ramírez 7032dfb4f1 Add GitHub Action to watch for missing preview docs (#1740)
* 📝 Update release notes

* 🔊 Make curl verbose when triggering docs preview

* 🔧 Update GitHub Actions circus to use commit hash

*  Add PR docs preview watcher
2020-07-20 16:33:17 +02:00

22 lines
506 B
Bash

#! /usr/bin/env bash
set -x
set -e
PR=${PR}
if [ -z "$PR" ]; then
echo "Not a PR build, skip trigger docs preview"
exit 0
fi
NAME=${NAME:?Variable not set}
GITHUB_TOKEN=${GITHUB_TOKEN:?Variable not set}
curl -v \
-X POST \
-H "Authorization: token ${GITHUB_TOKEN}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/tiangolo/fastapi/actions/workflows/preview-docs.yml/dispatches \
-d '{"ref":"master", "inputs": {"pr": "'"${PR}"'", "name": "'"${NAME}"'"}}'