Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #8

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
48fe553
Create GitHub Actions
Jan 26, 2025
9ed576e
Update issues.yml
Deep-Dark-Forest Jan 26, 2025
5362876
Update issues.yml
Deep-Dark-Forest Jan 26, 2025
c93e340
Update issues.yml
Deep-Dark-Forest Jan 26, 2025
cff3b6a
Update issues.yml
Deep-Dark-Forest Jan 26, 2025
126c77d
Update issues.yml
Deep-Dark-Forest Jan 26, 2025
d39e6eb
Update issues.yml
Deep-Dark-Forest Jan 26, 2025
49ef8d4
Update issues.yml
Deep-Dark-Forest Jan 26, 2025
d5e9326
Update issues.yml
Deep-Dark-Forest Jan 26, 2025
dacfbcb
Update issues.yml
Deep-Dark-Forest Jan 26, 2025
36900a3
Update issues.yml
Deep-Dark-Forest Jan 26, 2025
944a4f4
Update issues.yml
Deep-Dark-Forest Jan 26, 2025
b2eb2df
Update issues.yml
Deep-Dark-Forest Jan 28, 2025
f115514
Update issues.yml
Deep-Dark-Forest Jan 28, 2025
881a123
Update issues.yml
Deep-Dark-Forest Jan 28, 2025
b900e7f
Update issues.yml
Deep-Dark-Forest Jan 28, 2025
6dc0f03
Update issues.yml
Deep-Dark-Forest Jan 28, 2025
8f27ff0
Create labels.yml
Deep-Dark-Forest Jan 28, 2025
473ee14
Update labels.yml
Deep-Dark-Forest Jan 28, 2025
1664fcf
Update issues.yml
Deep-Dark-Forest Jan 28, 2025
b6a2a1c
Update issues.yml
Deep-Dark-Forest Jan 28, 2025
e524276
Update issues.yml
Deep-Dark-Forest Jan 28, 2025
6eac95a
Update labels.yml
Deep-Dark-Forest Jan 28, 2025
67547da
Update issues.yml
Deep-Dark-Forest Jan 28, 2025
41048be
Update labels.yml
Deep-Dark-Forest Jan 28, 2025
2a72aed
更新 labels.yml
Deep-Dark-Forest Jan 28, 2025
23c1b75
Update labels.yml
Deep-Dark-Forest Jan 29, 2025
7d22705
Update issues.yml
Deep-Dark-Forest Jan 29, 2025
293a101
Rename issues.yml to issue-close.yml
Deep-Dark-Forest Jan 29, 2025
92e7470
Update issue-close.yml
Deep-Dark-Forest Jan 29, 2025
2fce8c2
Create pr.yml
Deep-Dark-Forest Jan 29, 2025
8a829cd
Update issue-close.yml
Deep-Dark-Forest Jan 29, 2025
af0814b
Update pr.yml
Deep-Dark-Forest Jan 29, 2025
cebbbb1
Update README.md
Deep-Dark-Forest Jan 29, 2025
c63de70
Update .editorconfig
Deep-Dark-Forest Feb 2, 2025
fe4f03d
Merge pull request #11 from PCL-Community/Deep-Dark-Forest-patch-2
Deep-Dark-Forest Feb 2, 2025
6579140
Revert "Update .editorconfig"
Deep-Dark-Forest Feb 2, 2025
c1007fa
Merge pull request #12 from PCL-Community/revert-11-Deep-Dark-Forest-…
Deep-Dark-Forest Feb 2, 2025
7988a79
Revert "Revert "Update .editorconfig""
Deep-Dark-Forest Feb 2, 2025
4c01462
Merge pull request #13 from PCL-Community/revert-12-revert-11-Deep-Da…
Deep-Dark-Forest Feb 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[*.{cs,vb}]

# IDE0028: 简化集合初始化
dotnet_style_collection_initializer = true:silent
dotnet_style_collection_initializer true:silent
40 changes: 40 additions & 0 deletions .github/workflows/issue-close.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: close labeled issues

on:
issues:
types:
- labeled

jobs:
manage_issues:
runs-on: ubuntu-latest

steps:
- name: Set up authentication
run: echo "GITHUB_TOKEN=${{ secrets.BOT }}" >> $GITHUB_ENV

- name: Install jq
run: sudo apt-get update && sudo apt-get install -y jq

- name: Handle labeled issues
if: github.event.action == 'labeled'
run: |
if [[ "${{ github.event.label.name }}" == "❌ 拒绝" || "${{ github.event.label.name }}" == "😂 移交上游" || "${{ github.event.label.name }}" == "❌ 忽略" || "${{ github.event.label.name }}" == "❌ 第三方" || "${{ github.event.label.name }}" == "❌ 暂无计划"]]; then
curl -X PATCH \
-H "Authorization: token ${{ secrets.BOT }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }} \
-d '{"state": "closed", "state_reason": "not_planned"}'
elif [[ "${{ github.event.label.name }}" == "👌 完成" ]]; then
curl -X PATCH \
-H "Authorization: token ${{ secrets.BOT }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }} \
-d '{"state": "closed", "state_reason": "completed"}'
elif [[ "${{ github.event.label.name }}" == "❌ 重复" ]]; then
curl -X PATCH \
-H "Authorization: token ${{ secrets.BOT }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }} \
-d '{"state": "closed", "state_reason": "duplicate"}'
fi
52 changes: 52 additions & 0 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Add labels based on issue closure reason

on:
issues:
types: [closed]

jobs:
add-labels:
runs-on: ubuntu-latest
steps:
- name: Check if the issue was closed as completed and add label
uses: actions/github-script@v6
with:
github-token: ${{ secrets.BOT }}
script: |
if (context.payload.issue.state_reason === 'completed') {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
labels: ['👌 完成']
});
}

- name: Check if the issue was closed as duplicate and add label
uses: actions/github-script@v6
with:
github-token: ${{ secrets.BOT }}
script: |
if (context.payload.issue.state_reason === 'duplicate') {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
labels: ['❌ 重复']
});
}

- name: Check if the issue was closed as not planned and add label
uses: actions/github-script@v6
with:
github-token: ${{ secrets.BOT }}
script: |
if (context.payload.issue.state_reason === 'not_planned') {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
labels: ['❌ 忽略']
});
}

43 changes: 43 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Auto Label and Close PRs

on:
pull_request:
types: [closed, labeled]

jobs:

label_on_merge:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
- name: Add "👌 完成" label on merge
uses: actions-ecosystem/action-add-labels@v1
with:
labels: "👌 完成"
repo-token: ${{ secrets.BOT }}

close_pr_on_specific_labels:
runs-on: ubuntu-latest
if: github.event.action == 'labeled'
steps:
- name: Check for specific labels and close PR
id: check_label
run: |
case "${{ github.event.label.name }}" in
"❌ 忽略"|"❌ 拒绝"|"❌ 暂无计划"|"❌ 第三方"|"❌ 重复"|"😂 移交上游")
echo "::set-output name=should_close::true"
;;
*)
echo "::set-output name=should_close::false"
;;
esac
- name: Close PR
if: steps.check_label.outputs.should_close == 'true'
env:
BOT_TOKEN: ${{ secrets.BOT }}
run: |
curl -X PATCH \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token $BOT_TOKEN" \
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_number }} \
-d '{"state": "closed"}'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PCL Community Edition

[![Stars](https://img.shields.io/github/stars/PCL-Community/PCL2-CE?style=flat&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTggLjI1YS43NS43NSAwIDAgMSAuNjczLjQxOGwxLjg4MiAzLjgxNSA0LjIxLjYxMmEuNzUuNzUgMCAwIDEgLjQxNiAxLjI3OWwtMy4wNDYgMi45Ny43MTkgNC4xOTJhLjc1MS43NTEgMCAwIDEtMS4wODguNzkxTDggMTIuMzQ3bC0zLjc2NiAxLjk4YS43NS43NSAwIDAgMS0xLjA4OC0uNzlsLjcyLTQuMTk0TC44MTggNi4zNzRhLjc1Ljc1IDAgMCAxIC40MTYtMS4yOGw0LjIxLS42MTFMNy4zMjcuNjY4QS43NS43NSAwIDAgMSA4IC4yNVoiIGZpbGw9IiNlYWM1NGYiLz48L3N2Zz4=&logoSize=auto&label=Stars&labelColor=444444&color=eac54f)](https://github.com/PCL-Community/PCL2-CE/)
[![Stars](https://img.shields.io/github/stars/PCL-Community/PCL2-CE?style=flat&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTggLjI1YS43NS43NSAwIDAgMSAuNjczLjQxOGwxLjg4MiAzLjgxNSA0LjIxLjYxMmEuNzUuNzUgMCAwIDEgLjQxNiAxLjI3OWwtMy4wNDYgMi45Ny43MTkgNC4xOTJhLjc1MS43NTEgMCAwIDEtMS4wODguNzkxTDggMTIuMzQ3bC0zLjc2NiAxLjk4YS43NS43NSAwIDAgMS0xLjA4OC0uNzlsLjcyLTQuMTk0TC44MTggNi4zNzRhLjc1Ljc1IDAgMCAxIC40MTYtMS4yOGw0LjIxLS42MTFMNy4zMjcuNjY4QS43NS43NSAwIDAgMSA4IC4yNVoiIGZpbGw9IiNlYWM1NGYiLz48L3N2Zz4=&logoSie=auto&label=Stars&labelColor=444444&color=eac54f)](https://github.com/PCL-Community/PCL2-CE/)
[![Issues](https://img.shields.io/github/issues/PCL-Community/PCL2-CE?style=flat&label=Issues&labelColor=444444&color=1F883D)](https://github.com/PCL-Community/PCL2-CE/issues)
[![哔哩哔哩](https://img.shields.io/badge/动态-BiliBili-00A4DB?style=flat&labelColor=444444&logoSize=auto)](https://space.bilibili.com/11343203/dynamic)
[![爱发电](https://img.shields.io/badge/赞助-爱发电-946ce6?style=flat&labelColor=444444&logoSize=auto)](https://afdian.com/@LTCat)
Expand Down