mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-11-30 16:37:18 +01:00
Run preview scripts directly, use timestamps for the deployment timeout, and remove .nojekyll creation and the jq availability check. Allow the preview scripts to keep their executable bit in lint-chmod.
21 lines
651 B
Bash
Executable File
21 lines
651 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
: "${GH_TOKEN:?}"
|
|
: "${GITHUB_REPOSITORY:?}"
|
|
: "${PR:?}"
|
|
: "${BODY:?}"
|
|
|
|
marker="<!-- viewer-preview -->"
|
|
comment_id="$(gh api --paginate "repos/${GITHUB_REPOSITORY}/issues/${PR}/comments" \
|
|
--jq ".[] | select(.user.login == \"github-actions[bot]\" and (.body | startswith(\"${marker}\"))) | .id" |
|
|
tail -n1)"
|
|
|
|
if [ -n "$comment_id" ]; then
|
|
gh api "repos/${GITHUB_REPOSITORY}/issues/comments/${comment_id}" \
|
|
--method PATCH -F "body=@${BODY}" --silent
|
|
elif [ "${CREATE:-true}" = true ]; then
|
|
gh api "repos/${GITHUB_REPOSITORY}/issues/${PR}/comments" \
|
|
--method POST -F "body=@${BODY}" --silent
|
|
fi
|