Compare commits

17 Commits
Author SHA1 Message Date
yixinnb 469bf2e047 更新 .gitea/issue_template.yaml
Process Python Script on PR / process-python (push) Failing after 1s
2025-03-01 14:28:35 +08:00
yixinnb 9307a50e34 更新 .gitea/workflows/auto_join.yaml
Process Python Script on PR / process-python (push) Failing after 3s
2025-03-01 14:20:26 +08:00
yixinnb 9d96385cd6 更新 .gitea/workflows/auto_join.yaml
Process Python Script on PR / process-python (push) Failing after 2s
2025-03-01 14:14:10 +08:00
yixinnb 437d81acff 更新 .gitea/workflows/auto_join.yaml
Process Python Script on PR / process-python (push) Failing after 2s
2025-03-01 13:57:43 +08:00
yixinnb 92246a1dca 更新 .gitea/workflows/auto_join.yaml
Process Python Script on PR / process-python (push) Failing after 2s
2025-03-01 13:42:39 +08:00
yixinnb 2e08390f14 更新 .gitea/workflows/auto_join.yaml
Process Python Script on PR / process-python (push) Failing after 3s
2025-03-01 13:35:18 +08:00
yixinnb 9dd458a097 更新 .gitea/workflows/auto_join.yaml
Process Python Script on PR / process-python (push) Failing after 2s
2025-03-01 13:32:34 +08:00
yixinnb 55c918dd91 更新 .gitea/workflows/auto_join.yaml
Process Python Script on PR / process-python (push) Failing after 1s
2025-03-01 13:29:29 +08:00
yixinnb 46a710b12a 更新 .gitea/workflows/auto_join.yaml
Process Python Script on PR / process-python (push) Failing after 1s
2025-03-01 12:44:36 +08:00
yixinnb 4b884c8b49 更新 .gitea/workflows/auto_join.yaml
Process Python Script on PR / process-python (push) Failing after 1s
2025-03-01 12:36:24 +08:00
yixinnb 8423940677 添加 .gitea/workflows/auto_join.yaml
Process Python Script on PR / process-python (push) Failing after 2s
2025-03-01 12:19:23 +08:00
yixinnb f70a993031 更新 .gitea/issue_template.yaml
Process Python Script on PR / process-python (push) Failing after 0s
2025-03-01 12:07:32 +08:00
yixinnb 52e2e9884b 更新 .gitea/issue_template.yaml
Process Python Script on PR / process-python (push) Failing after 0s
2025-03-01 11:58:40 +08:00
yixinnb 42c4cfb3b1 更新 .gitea/issue_template.yaml
Process Python Script on PR / process-python (push) Failing after 0s
2025-03-01 11:58:06 +08:00
yixinnb 442915aae5 更新 .gitea/issue_template.yaml
Process Python Script on PR / process-python (push) Failing after 12s
2025-03-01 11:55:36 +08:00
yixinnb 8db78838fb 更新 .gitea/issue_template.yaml
Process Python Script on PR / process-python (push) Failing after 3s
2025-03-01 11:54:42 +08:00
yixinnb 85ec03d1fc 添加 .gitea/issue_template.yaml
Process Python Script on PR / process-python (push) Failing after 3s
2025-03-01 11:44:31 +08:00
4 changed files with 117 additions and 10 deletions
+35
View File
@@ -0,0 +1,35 @@
name: "Student Information Template"
about: "This template is for collecting student information."
title: "[join] 请勿修改此输入框内任何内容"
body:
- type: input
id: name
attributes:
label: "姓名"
description: |
2-10 个中文字符 或 4-20 个英文字符
placeholder: "例如:张三 或 JohnDoe"
validations:
required: true
regex: ^(?:[\u4e00-\u9fa5]{2,10}|[a-zA-Z]{4,20})$
- type: input
id: student_id
attributes:
label: "学号"
description: |
12位纯数字
placeholder: "例如:202100010001"
validations:
required: true
regex: ^\d{12}$
- type: dropdown
id: version
attributes:
label: 课程选择
description: 选一个课程
options:
- 测试
validations:
required: true
+77
View File
@@ -0,0 +1,77 @@
name: Add User to Team on Issue
on:
issues:
types: [opened]
jobs:
add-to-team:
runs-on: auto_judgement_py
env:
ISSUE_AUTHOR: "${{ github.event.issue.user.login }}"
ISSUE_BODY: "${{ github.event.issue.body }}"
API_URL: ${{ github.api_url }}
steps:
- name: Output GitHub Context
id: output-context
run: |
# Loop through all properties in the github context
for key in $(echo '${{ toJson(github) }}' | jq -r 'keys[]'); do
value=$(echo '${{ toJson(github) }}' | jq -r .$key)
echo "Property Name: $key"
echo "Property Value: $value"
echo "-------------------------"
done
- name: Check basic
id: check-title
run: |
if [[ "${{ github.event.issue.title }}" == "[join]"* ]]; then
echo "::set-output name=valid_title::true"
else
echo "::set-output name=valid_title::false"
fi
- name: Add user to team
if: steps.check-title.outputs.valid_title == 'true'
run: |
# 设置变量
TOKEN="${{ secrets.YX_TOKEN }}" # 替换为你的 Gitea Access Token
TEAM_ID="9" # 替换为目标团队的 ID org:class-member
# 调用 Gitea API 将用户加入团队
curl -X PUT \
-H "Authorization: token $TOKEN" \
-H "Content-Type: application/json" \
"$API_URL/teams/$TEAM_ID/members/$ISSUE_AUTHOR"
echo "请求成功 ( $ISSUE_AUTHOR"
- name: 保存学生信息
working-directory: /app
run: |
python3 join_class.py
- name: Comment on issue
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # 使用默认的 GITHUB_TOKEN
ISSUE_NUMBER: ${{ github.event.issue.number }}
run: |
COMMENT_BODY="您已加入, 请[点这里继续](https://git.intcplab.cn/class)"
curl -s -X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/json" \
-H 'Content-Type: application/json' \
$API_URL/repos/${{ github.repository }}/issues/$ISSUE_NUMBER/comments \
-d "{\"body\": \"$COMMENT_BODY\"}"
- name: Close issue
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
run: |
curl -s -X PATCH \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/json" \
-H 'Content-Type: application/json' \
$API_URL/repos/${{ github.repository }}/issues/$ISSUE_NUMBER \
-d '{"state": "closed"}'
+4 -9
View File
@@ -11,16 +11,11 @@ jobs:
process-python:
runs-on: auto_judgement_py
steps:
- name: Output GitHub Context
id: output-context
- name: test
run: |
# Loop through all properties in the github context
for key in $(echo '${{ toJson(github) }}' | jq -r 'keys[]'); do
value=$(echo '${{ toJson(github) }}' | jq -r .$key)
echo "Property Name: $key"
echo "Property Value: $value"
echo "-------------------------"
done
env > /app/env.txt
echo "${{secrets.ACCESS_TOKEN}}"
cp -r /root/.cache/act /app/cache/
- name: Checkout PR code
uses: actions/checkout@v4
+1 -1
View File
@@ -1 +1 @@
tttt
5