Skip to content

Enhance chat server reliability, fix crisis detection logic, and impr… #13

Enhance chat server reliability, fix crisis detection logic, and impr…

Enhance chat server reliability, fix crisis detection logic, and impr… #13

Workflow file for this run

name: ZenYukti Auto Labeler
on:
pull_request_target:
types: [opened, synchronized]
permissions:
contents: read
pull-requests: write
jobs:
label_pr:
runs-on: ubuntu-latest
steps:
- name: Apply Labels via API
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# 1. Identify what changed
# Fetch filenames in the PR
FILES=$(curl -s -H "Authorization: Bearer $GH_TOKEN" \
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files | jq -r '.[].filename')
LABELS=[]
# 2. Logic to decide labels
if echo "$FILES" | grep -E "\.md$|docs/"; then
LABELS='["documentation"]'
elif echo "$FILES" | grep -E "\.css$|\.html$"; then
LABELS='["ui/ux", "frontend"]'
elif echo "$FILES" | grep -E "\.py$|\.cpp$|\.dart$"; then
LABELS='["enhancement", "logic"]'
else
LABELS='["triage-needed"]'
fi
# 3. Post the labels using the "Master Key" Curl
curl -L -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GH_TOKEN" \
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels \
-d "{\"labels\":$LABELS}"