ci: skip honeypot for local bot PRs (#1209)

Signed-off-by: Hampus Kraft <hampus@fluxer.com>
This commit is contained in:
Hampus
2026-06-28 06:28:19 +02:00
committed by GitHub
parent 8a0a049dee
commit fa060d1c52
@@ -45,10 +45,17 @@ jobs:
fi
author="$(jq -r '.pull_request.user.login' "$GITHUB_EVENT_PATH")"
author_type="$(jq -r '.pull_request.user.type // ""' "$GITHUB_EVENT_PATH")"
author_association="$(jq -r '.pull_request.author_association' "$GITHUB_EVENT_PATH")"
head_repository="$(jq -r '.pull_request.head.repo.full_name // ""' "$GITHUB_EVENT_PATH")"
body_file="$(mktemp)"
jq -r '.pull_request.body // ""' "$GITHUB_EVENT_PATH" > "$body_file"
if [ "$author_type" = "Bot" ] && [ "$head_repository" = "$GITHUB_REPOSITORY" ]; then
echo "Skipping repository-local bot pull request: $author"
exit 0
fi
if grep -Fq "$HONEYPOT_MARKER" "$body_file"; then
echo "Honeypot marker is present."
exit 0