mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-08-29 03:44:06 +08:00
Update webhook trigger for feat PRs
This commit is contained in:
@@ -1,26 +1,35 @@
|
||||
name: Documentation Webhook on trigger on Feat PRs
|
||||
name: Trigger webhook for feat PRs
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [closed]
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
webhook:
|
||||
# Only run if the PR was merged AND the head branch name contains 'feat'
|
||||
if: github.event.pull_request.merged == true && contains(github.event.pull_request.head.ref, 'feat')
|
||||
call-webhook:
|
||||
if: >
|
||||
github.event.pull_request.merged == true &&
|
||||
startsWith(github.event.pull_request.title, 'feat:')
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Send Webhook
|
||||
- name: Send webhook safely
|
||||
run: |
|
||||
curl -X POST ${{ secrets.DOC_WEBHOOK_URL }} \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"repo": "${{ github.repository }}",
|
||||
"pr_number": "${{ github.event.pull_request.number }}",
|
||||
"title": "${{ github.event.pull_request.title }}",
|
||||
"description": "${{ github.event.pull_request.body }}",
|
||||
"author": "${{ github.event.pull_request.user.login }}",
|
||||
"merged_at": "${{ github.event.pull_request.merged_at }}"
|
||||
}'
|
||||
payload=$(jq -n \
|
||||
--arg repo "${GITHUB_REPOSITORY}" \
|
||||
--arg pr_number "${{ github.event.pull_request.number }}" \
|
||||
--arg title "${{ github.event.pull_request.title }}" \
|
||||
--arg body "${{ github.event.pull_request.body }}" \
|
||||
--arg author "${{ github.event.pull_request.user.login }}" \
|
||||
--arg merged_at "${{ github.event.pull_request.merged_at }}" \
|
||||
'{
|
||||
repo: $repo,
|
||||
pr_number: $pr_number,
|
||||
title: $title,
|
||||
description: $body,
|
||||
author: $author,
|
||||
merged_at: $merged_at
|
||||
}'
|
||||
)
|
||||
curl --fail-with-body -X POST "${{ secrets.DOC_WEBHOOK_URL }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
--data-raw "$payload"
|
||||
|
||||
Reference in New Issue
Block a user