Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
61 changes: 61 additions & 0 deletions .github/ISSUE_TEMPLATE/interview-question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: 📝 提交面经
description: 提交一份已经用 Skill 格式化的完整面试记录
title: "[面经] 请填写投稿人-公司-岗位-轮次"
labels:
- question-submission
body:
- type: dropdown
id: company_category
attributes:
label: 请选择面经要收录的目录
options:
- 大厂
- 中厂
- 小厂
validations:
required: true

- type: markdown
attributes:
value: |
感谢投稿!请先用仓库中的 [interview-question Skill](https://github.com/oxkrypton/GoClub/blob/main/skills/interview-question/SKILL.md) 整理整场面试,再把输出结果粘贴到下面。
ai生成不一定准确可以进行微调, title可以填上自己的名字, 方便辨别 (匿名也可以!)
一次 Issue 只提交一场面试。为了避免外层代码块和正文代码块冲突,请使用 **四个反引号** 包裹整份 Markdown:


- type: textarea
id: standardized_markdown
attributes:
label: 标准化 Markdown
description: 只粘贴 Skill 输出的完整面经 Markdown,并用四个反引号代码块包裹。
placeholder: |
````markdown
---
title: "xxx-字节跳动Golang一面"
difficulty: "hard"
---

# 字节跳动Golang

1. 第一个 PR 修复了什么问题?

## 参考答案(AI 生成)

> 以下答案由 AI 生成,仅供面试复盘参考。

### 1. 第一个 PR 修复了什么问题?

答:结合真实项目经历说明。
````
validations:
required: true

- type: checkboxes
id: format_confirmation
attributes:
label: 投稿确认
options:
- label: 我已通过 interview-question Skill 格式化。
required: true
- label: 我确认内容不包含保密信息,不侵犯他人版权,且没有恶意链接或脚本。
required: true
111 changes: 111 additions & 0 deletions .github/workflows/interview-question-submission.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: 处理面经投稿

on:
issues:
types:
- opened

permissions:
contents: write
issues: write
pull-requests: write

concurrency:
group: interview-question-${{ github.event.issue.number || github.run_id }}
cancel-in-progress: false

env:
CONTENT_ROOT: content/docs/interview

jobs:
create-pr:
name: 生成投稿 PR
runs-on: ubuntu-latest
timeout-minutes: 10
if: >
contains(github.event.issue.labels.*.name, 'question-submission') ||
contains(github.event.issue.body, '### 标准化 Markdown')
steps:
- name: 检出默认分支
uses: actions/checkout@v4
with:
ref: ${{ github.event.repository.default_branch || 'main' }}
submodules: false
fetch-depth: 1

- name: 感谢投稿并补齐标签
env:
GH_TOKEN: ${{ github.token }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
run: |
gh issue comment "$ISSUE_NUMBER" \
--body "感谢投稿!系统会自动生成 PR,管理员审核后合并。"
gh label create question-submission \
--color 0E8A16 \
--description "面经自动投稿" || true
if [[ -n "$ISSUE_NUMBER" ]]; then
gh issue edit "$ISSUE_NUMBER" --add-label question-submission
fi

- name: 提取投稿并生成页面
id: import
env:
ISSUE_NUMBER: ${{ github.event.issue.number }}
run: |
python3 scripts/process_interview_question.py \
--payload "$GITHUB_EVENT_PATH" \
--content-root "$CONTENT_ROOT" \
--write

- name: 检查待提交范围
env:
CONTENT_PATH: ${{ steps.import.outputs.content_path }}
run: |
git add -- "$CONTENT_PATH"
changed="$(git diff --cached --name-only)"
if [[ "$changed" != "$CONTENT_PATH" ]]; then
echo "本次自动化只能提交一个面经文件,实际待提交文件:"
echo "$changed"
exit 1
fi
git diff --cached --check

- name: 创建分支、提交并生成 PR
env:
GH_TOKEN: ${{ github.token }}
BRANCH: ${{ steps.import.outputs.target_branch }}
CONTENT_PATH: ${{ steps.import.outputs.content_path }}
PR_TITLE: ${{ steps.import.outputs.pr_title }}
ISSUE_NUMBER: ${{ steps.import.outputs.issue_number }}
SUBMITTER: ${{ steps.import.outputs.submitter }}
run: |
if git ls-remote --exit-code --heads origin "$BRANCH" >/dev/null; then
existing_pr="$(gh pr list --head "$BRANCH" --state open --json number --jq '.[0].number // empty')"
if [[ -n "$existing_pr" ]]; then
gh issue comment "$ISSUE_NUMBER" --body "✅ 该投稿已生成 PR,管理员审核通过后将合并上线 #$existing_pr。"
exit 0
fi
echo "分支 $BRANCH 已存在但没有打开的 PR,请管理员删除旧分支后重新触发。" >&2
exit 1
fi

git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git switch -c "$BRANCH"
git commit -m "面经收录:Issue #$ISSUE_NUMBER"
git push -u origin "$BRANCH"

pr_url="$(gh pr create \
--base "${{ github.event.repository.default_branch || 'main' }}" \
--head "$BRANCH" \
--title "$PR_TITLE" \
--body "由 Issue #$ISSUE_NUMBER 自动生成,感谢贡献者 @$SUBMITTER。

Closes #$ISSUE_NUMBER

- 自动化来源:Issue Form
- 合并后会由现有部署流程自动构建发布

管理员审核合并后会自动发布上线")"

gh issue comment "$ISSUE_NUMBER" --body "✅ 已为你自动生成,管理员审核通过后将合并上线 $pr_url。"
Loading
Loading