Skip to content

[pull] main from PCL-Community:main #4

[pull] main from PCL-Community:main

[pull] main from PCL-Community:main #4

Workflow file for this run

name: PR Label Automation
on:
pull_request:
types: [labeled, closed]
jobs:
handle_labels:
runs-on: ubuntu-latest
steps:
# 自动关闭带有特定标签的PR
- name: Close PR with specific labels
if: |
github.event.action == 'labeled' &&
contains('❌ 拒绝,😂 移交上游,❌ 忽略,❌ 第三方,❌ 暂无计划,❌ 重复', github.event.label.name)
run: |
curl -sS -X PATCH \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.BOT }}" \
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}" \
-d '{"state": "closed"}'
# 合并后添加完成标签
- name: Add merged label
if: |
github.event.action == 'closed' &&
github.event.pull_request.merged == true
run: |
curl -sS -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.BOT }}" \
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels" \
-d '{"labels":["👌 完成"]}'