From 0236d1e9304572c00d05c7fb41e5ca1749090c00 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Mar 2026 17:25:44 +0000 Subject: [PATCH 1/9] Initial plan From e6cde1f84d73f9e3f7d0adff1524b0a8a48d25e1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Mar 2026 17:31:01 +0000 Subject: [PATCH 2/9] Set up GoodAction Hub data repository: update issue templates, README, and data structure Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com> --- .../ISSUE_TEMPLATE/Fake-Open-Source-event.yml | 115 ----------------- .github/ISSUE_TEMPLATE/activity.yml | 115 +++++++++++++++++ .github/ISSUE_TEMPLATE/competition.yml | 116 ++++++++++++++++++ .github/ISSUE_TEMPLATE/conference.yml | 116 ++++++++++++++++++ .github/settings.yml | 12 +- README.md | 73 ++++++++--- data/{events.yml => activities.yml} | 0 data/competitions.yml | 0 data/conferences.yml | 0 9 files changed, 415 insertions(+), 132 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/Fake-Open-Source-event.yml create mode 100644 .github/ISSUE_TEMPLATE/activity.yml create mode 100644 .github/ISSUE_TEMPLATE/competition.yml create mode 100644 .github/ISSUE_TEMPLATE/conference.yml rename data/{events.yml => activities.yml} (100%) create mode 100644 data/competitions.yml create mode 100644 data/conferences.yml diff --git a/.github/ISSUE_TEMPLATE/Fake-Open-Source-event.yml b/.github/ISSUE_TEMPLATE/Fake-Open-Source-event.yml deleted file mode 100644 index 49edc2e..0000000 --- a/.github/ISSUE_TEMPLATE/Fake-Open-Source-event.yml +++ /dev/null @@ -1,115 +0,0 @@ -name: 伪开源事件报告 / Fake Open Source event report -description: 报告一个伪开源事件 / Report a Fake Open Source event -title: "替换为事件的一句话描述 / Replace with an one-sentence description of the event" -labels: - - event - - documentation -body: - - type: markdown - attributes: - value: | - ## 免责声明 / Disclaimer - - - **隐私政策 / Privacy Policy**:施害过程中施害人暴露的个人信息不属于隐私,除此之外所有人均应受隐私保护。/ Personal information exposed by the perpetrator during the harmful process is not protected by privacy laws. Beyond that, all individuals should be protected by privacy rights. - - - **信息来源 / Information Source**:本平台仅提供基于 Git 的分布式信息存储,信息真实性由发布者负责,并由网友辨别、辟谣。/ This platform only provides decentralized information storage based on Git. The authenticity of information is the responsibility of the publisher, and is to be verified and fact-checked by the community. - - - type: input - id: tags - attributes: - label: 分类标签 / Category Tags - description: 请用英文逗号或空格分隔多个标签 / Please use English comma or space to separate multiple tags - placeholder: "用英文逗号或空格分隔,例如:malware, scam, plagiarism, trojan / Separated by comma or space, example: malware, scam, plagiarism, trojan" - validations: - required: true - - - type: input - id: start_time - attributes: - label: 发生时间 / Start Time - description: 事件开始的具体时间 / The specific date and time when the event started - placeholder: "例如:2024-01-15 / Example: 2024-01-15" - validations: - required: true - - - type: input - id: end_time - attributes: - label: 结束时间 / End Time - description: 事件结束的具体时间(如果事件已结束) / The specific date and time when the event ended (if applicable) - placeholder: "例如:2024-01-20 / Example: 2024-01-20" - - - type: input - id: location - attributes: - label: 发生地点 / Location - description: 线下地址、线上网址、某群聊名称等 / Offline address, online URL, chat group name, etc. - placeholder: "例如:某 GitHub 项目 | https://example.com | 某微信群 | 某 Discord 服务器 / Example: XYZ GitHub Project | https://example.com | WeChat Group XYZ | Discord Server XYZ" - validations: - required: true - - - type: textarea - id: hypocrite - attributes: - label: 伪开源人 / Hypocrite - description: 列出 @GitHub 账号、社交媒体个人主页网址、网名、姓名等 / List @GitHub accounts, social media profile links, usernames, names, etc. - placeholder: | - - @GitHub 账号 或 GitHub 个人主页 / @GitHub username or GitHub profile link - - 社交媒体账号或个人主页链接 / Social media account or personal profile link - - 网名、姓名 / Username, name - 例如: - - @user123 - - https://twitter.com/scammer - - 网名:诈骗王 / Username: scammer_xyz - validations: - required: true - - - type: textarea - id: event_details - attributes: - label: 事件经过 / Event Details - description: 用 Markdown 4 级及以上标题、项目列表等语法罗列,可贴网址、截图等证据 / Use Markdown level 4+ headings, bullet lists, etc. to describe the event. Include URLs, screenshots, and evidence. - placeholder: | - 请使用 Markdown 格式(4 级及以上标题、项目列表等语法)详细描述事件经过,可贴网址、截图等证据 / Please use Markdown format (level 4+ headings, bullet lists, etc.) to describe the event in detail. You can include URLs, screenshots, and other evidence. - - #### 事件时间线 / Timeline - - 时间点1:发生了什么 / Time point 1: What happened - - 时间点2:发生了什么 / Time point 2: What happened - - #### 关键证据 / Key Evidence - - [链接1](https://example.com) - - [链接2](https://example.com) - validations: - required: true - - - type: input - id: money - attributes: - label: 涉及资金 / Currency & Amount - description: 请直接填写类似“CNY ¥100”或“USD $200”的格式,用币种缩写+符号+数值 / Please enter in a format such as "CNY ¥100" or "USD $200", using currency abbreviation + symbol + value - placeholder: "例如:CNY ¥100 或 USD $200 / Example: CNY ¥100 or USD $200" - - - type: textarea - id: assets - attributes: - label: 涉及财物 / Involved Assets - description: 用 Markdown 4 级及以上标题、项目列表等语法罗列,可贴网址、截图等证据 / Use Markdown level 4+ headings, bullet lists, etc. to describe. Include URLs, screenshots, and evidence - placeholder: | - 请使用 Markdown 格式(4 级及以上标题、项目列表等语法)详细描述,可贴网址、截图等证据 / Please use Markdown format (level 4+ headings, bullet lists, etc.) to describe in detail. Include URLs, screenshots, and other evidence. - - #### 财物清单 / Assets List - - 财物类型:描述 / Asset type: description - - 财物类型:描述 / Asset type: description - - #### 相关证据 / Related Evidence - - [链接](https://example.com) - - - type: checkboxes - id: confirmation - attributes: - label: 我确认 / I Confirm - options: - - label: 我已阅读并同意隐私政策声明 / I have read and agree to the privacy policy statement - required: true - - label: 提供的信息真实准确 / The information provided is truthful and accurate - required: true diff --git a/.github/ISSUE_TEMPLATE/activity.yml b/.github/ISSUE_TEMPLATE/activity.yml new file mode 100644 index 0000000..67df543 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/activity.yml @@ -0,0 +1,115 @@ +name: 提交公益活动 / Submit Activity +description: 提交一个公益活动信息,添加到 data/activities.yml / Submit a public welfare activity to be added to data/activities.yml +title: "[活动] 活动名称 / [Activity] Activity Title" +labels: + - activity +body: + - type: markdown + attributes: + value: | + ## 提交说明 / Submission Guidelines + + 请参考 [数据结构说明](../blob/main/README.md#数据结构) 填写以下信息,您提交的活动将被添加到 `data/activities.yml`。 + Please refer to the [data structure documentation](../blob/main/README.md#数据结构) and fill in the following fields. Your submission will be added to `data/activities.yml`. + + - type: input + id: title + attributes: + label: 活动名称 / Activity Title + description: 活动的完整名称 / Full name of the activity + placeholder: "例如:第三届老龄志愿与公益服务学术论坛 / Example: 3rd Academic Forum on Elderly Volunteering and Public Welfare Services" + validations: + required: true + + - type: textarea + id: description + attributes: + label: 活动简介 / Activity Description + description: 活动的简要介绍 / Brief description of the activity + placeholder: "请描述活动的主要内容、目的和意义 / Please describe the main content, purpose, and significance of the activity" + validations: + required: true + + - type: input + id: tags + attributes: + label: 分类标签 / Tags + description: 请用英文逗号分隔多个标签 / Please use commas to separate multiple tags + placeholder: "例如:志愿服务, 公益募捐, 上海, 线上活动 / Example: 志愿服务, 公益募捐, 上海, 线上活动" + validations: + required: true + + - type: input + id: year + attributes: + label: 年份 / Year + description: 活动举办年份 / Year the activity takes place + placeholder: "例如:2025" + validations: + required: true + + - type: input + id: id + attributes: + label: 唯一 ID / Unique ID + description: 活动的全局唯一标识符,建议使用英文小写和连字符 / Globally unique identifier for the activity, use lowercase English and hyphens + placeholder: "例如:yulin-heroic-deed-fundraising-2025" + validations: + required: true + + - type: input + id: link + attributes: + label: 活动链接 / Activity Link + description: 活动的官方链接或详情页面 / Official link or detail page of the activity + placeholder: "例如:https://mp.weixin.qq.com/s/... / Example: https://example.com/activity" + validations: + required: true + + - type: textarea + id: timeline + attributes: + label: 关键时间节点 / Timeline + description: 每行一个时间节点,格式为"ISO 8601 日期 | 说明",例如"2025-10-19T23:59:00 | 报名截止" / One timeline entry per line, format "ISO 8601 date | comment" + placeholder: | + 2025-10-01T09:00:00 | 活动开始 / Activity starts + 2025-10-31T17:00:00 | 活动结束 / Activity ends + validations: + required: true + + - type: input + id: timezone + attributes: + label: 时区 / Timezone + description: 请使用标准 IANA 时区名称 / Please use standard IANA timezone name + placeholder: "例如:Asia/Shanghai" + validations: + required: true + + - type: input + id: date + attributes: + label: 人类可读日期 / Human-readable Date + description: 人类可读的日期或日期范围 / Human-readable date or date range + placeholder: "例如:2025年10月1日 或 2025年10月1日-10月31日" + validations: + required: true + + - type: input + id: place + attributes: + label: 活动地点 / Place + description: 活动地点,线上活动直接填写"线上" / Location of the activity; write "线上" for online events + placeholder: "例如:中国,上海 或 线上 / Example: 中国,上海 or 线上" + validations: + required: true + + - type: checkboxes + id: confirmation + attributes: + label: 我确认 / I Confirm + options: + - label: 提供的信息真实准确 / The information provided is truthful and accurate + required: true + - label: 我已阅读数据结构说明 / I have read the data structure documentation + required: true diff --git a/.github/ISSUE_TEMPLATE/competition.yml b/.github/ISSUE_TEMPLATE/competition.yml new file mode 100644 index 0000000..80a9765 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/competition.yml @@ -0,0 +1,116 @@ +name: 提交公益竞赛 / Submit Competition +description: 提交一个公益竞赛信息,添加到 data/competitions.yml / Submit a public welfare competition to be added to data/competitions.yml +title: "[竞赛] 竞赛名称 / [Competition] Competition Title" +labels: + - competition +body: + - type: markdown + attributes: + value: | + ## 提交说明 / Submission Guidelines + + 请参考 [数据结构说明](../blob/main/README.md#数据结构) 填写以下信息,您提交的竞赛将被添加到 `data/competitions.yml`。 + Please refer to the [data structure documentation](../blob/main/README.md#数据结构) and fill in the following fields. Your submission will be added to `data/competitions.yml`. + + - type: input + id: title + attributes: + label: 竞赛名称 / Competition Title + description: 竞赛的完整名称 / Full name of the competition + placeholder: "例如:第五届"创新杯"中国高校ESG案例大赛 / Example: 5th Innovation Cup China University ESG Case Competition" + validations: + required: true + + - type: textarea + id: description + attributes: + label: 竞赛简介 / Competition Description + description: 竞赛的简要介绍 / Brief description of the competition + placeholder: "请描述竞赛的主要内容、参赛资格和意义 / Please describe the main content, eligibility, and significance of the competition" + validations: + required: true + + - type: input + id: tags + attributes: + label: 分类标签 / Tags + description: 请用英文逗号分隔多个标签 / Please use commas to separate multiple tags + placeholder: "例如:ESG, 案例大赛, 高校竞赛, 可持续发展 / Example: ESG, 案例大赛, 高校竞赛" + validations: + required: true + + - type: input + id: year + attributes: + label: 年份 / Year + description: 竞赛举办年份 / Year the competition takes place + placeholder: "例如:2025" + validations: + required: true + + - type: input + id: id + attributes: + label: 唯一 ID / Unique ID + description: 竞赛的全局唯一标识符,建议使用英文小写和连字符 / Globally unique identifier for the competition, use lowercase English and hyphens + placeholder: "例如:innovation-cup-esg-case-2025" + validations: + required: true + + - type: input + id: link + attributes: + label: 竞赛链接 / Competition Link + description: 竞赛的官方链接或详情页面 / Official link or detail page of the competition + placeholder: "例如:https://mp.weixin.qq.com/s/... / Example: https://example.com/competition" + validations: + required: true + + - type: textarea + id: timeline + attributes: + label: 关键时间节点 / Timeline + description: 每行一个时间节点,格式为"ISO 8601 日期 | 说明",例如"2025-09-01T00:00:00 | 报名开始" / One timeline entry per line, format "ISO 8601 date | comment" + placeholder: | + 2025-09-01T00:00:00 | 报名开始 / Registration starts + 2025-10-31T23:59:00 | 作品提交截止 / Submission deadline + 2025-12-01T09:00:00 | 颁奖典礼 / Award ceremony + validations: + required: true + + - type: input + id: timezone + attributes: + label: 时区 / Timezone + description: 请使用标准 IANA 时区名称 / Please use standard IANA timezone name + placeholder: "例如:Asia/Shanghai" + validations: + required: true + + - type: input + id: date + attributes: + label: 人类可读日期 / Human-readable Date + description: 人类可读的日期或日期范围 / Human-readable date or date range + placeholder: "例如:2025年9月1日 或 2025年9月1日-12月1日" + validations: + required: true + + - type: input + id: place + attributes: + label: 竞赛地点 / Place + description: 竞赛地点,线上竞赛直接填写"线上" / Location of the competition; write "线上" for online competitions + placeholder: "例如:中国,北京 或 线上 / Example: 中国,北京 or 线上" + validations: + required: true + + - type: checkboxes + id: confirmation + attributes: + label: 我确认 / I Confirm + options: + - label: 提供的信息真实准确 / The information provided is truthful and accurate + required: true + - label: 我已阅读数据结构说明 / I have read the data structure documentation + required: true diff --git a/.github/ISSUE_TEMPLATE/conference.yml b/.github/ISSUE_TEMPLATE/conference.yml new file mode 100644 index 0000000..a85b8aa --- /dev/null +++ b/.github/ISSUE_TEMPLATE/conference.yml @@ -0,0 +1,116 @@ +name: 提交公益会议 / Submit Conference +description: 提交一个公益会议信息,添加到 data/conferences.yml / Submit a public welfare conference to be added to data/conferences.yml +title: "[会议] 会议名称 / [Conference] Conference Title" +labels: + - conference +body: + - type: markdown + attributes: + value: | + ## 提交说明 / Submission Guidelines + + 请参考 [数据结构说明](../blob/main/README.md#数据结构) 填写以下信息,您提交的会议将被添加到 `data/conferences.yml`。 + Please refer to the [data structure documentation](../blob/main/README.md#数据结构) and fill in the following fields. Your submission will be added to `data/conferences.yml`. + + - type: input + id: title + attributes: + label: 会议名称 / Conference Title + description: 会议的完整名称 / Full name of the conference + placeholder: "例如:第六届公益慈善理论与政策研讨会 / Example: 6th Seminar on Charity Theory and Policy" + validations: + required: true + + - type: textarea + id: description + attributes: + label: 会议简介 / Conference Description + description: 会议的简要介绍 / Brief description of the conference + placeholder: "请描述会议的主要议题、目的和意义 / Please describe the main topics, purpose, and significance of the conference" + validations: + required: true + + - type: input + id: tags + attributes: + label: 分类标签 / Tags + description: 请用英文逗号分隔多个标签 / Please use commas to separate multiple tags + placeholder: "例如:公益慈善, 理论研究, 政策研讨, 社会保障 / Example: 公益慈善, 理论研究, 政策研讨" + validations: + required: true + + - type: input + id: year + attributes: + label: 年份 / Year + description: 会议举办年份 / Year the conference takes place + placeholder: "例如:2025" + validations: + required: true + + - type: input + id: id + attributes: + label: 唯一 ID / Unique ID + description: 会议的全局唯一标识符,建议使用英文小写和连字符 / Globally unique identifier for the conference, use lowercase English and hyphens + placeholder: "例如:charity-theory-policy-conference-2025" + validations: + required: true + + - type: input + id: link + attributes: + label: 会议链接 / Conference Link + description: 会议的官方链接或详情页面 / Official link or detail page of the conference + placeholder: "例如:https://mp.weixin.qq.com/s/... / Example: https://example.com/conference" + validations: + required: true + + - type: textarea + id: timeline + attributes: + label: 关键时间节点 / Timeline + description: 每行一个时间节点,格式为"ISO 8601 日期 | 说明",例如"2025-10-31T23:59:00 | 论文投稿截止" / One timeline entry per line, format "ISO 8601 date | comment" + placeholder: | + 2025-10-31T23:59:00 | 论文投稿截止 / Paper submission deadline + 2025-12-06T09:00:00 | 会议开始 / Conference starts + 2025-12-07T17:00:00 | 会议结束 / Conference ends + validations: + required: true + + - type: input + id: timezone + attributes: + label: 时区 / Timezone + description: 请使用标准 IANA 时区名称 / Please use standard IANA timezone name + placeholder: "例如:Asia/Shanghai" + validations: + required: true + + - type: input + id: date + attributes: + label: 人类可读日期 / Human-readable Date + description: 人类可读的日期或日期范围 / Human-readable date or date range + placeholder: "例如:2025年12月6日 或 2025年12月6日-12月7日" + validations: + required: true + + - type: input + id: place + attributes: + label: 会议地点 / Place + description: 会议地点,线上会议直接填写"线上" / Location of the conference; write "线上" for online conferences + placeholder: "例如:中国,北京 或 线上 / Example: 中国,北京 or 线上" + validations: + required: true + + - type: checkboxes + id: confirmation + attributes: + label: 我确认 / I Confirm + options: + - label: 提供的信息真实准确 / The information provided is truthful and accurate + required: true + - label: 我已阅读数据结构说明 / I have read the data structure documentation + required: true diff --git a/.github/settings.yml b/.github/settings.yml index e0f706f..bc5278e 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -48,9 +48,17 @@ labels: color: "#ffffff" description: This will not be worked on - - name: event + - name: activity color: "#0e8a16" - description: Fake Open Source event + description: Public welfare activity / 公益活动 + + - name: conference + color: "#1d76db" + description: Public welfare conference / 公益会议 + + - name: competition + color: "#e4e669" + description: Public welfare competition / 公益竞赛 branches: - name: main diff --git a/README.md b/README.md index 8df911a..d323730 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,68 @@ -# 伪开源百科 / Fake Open Source wiki +# GoodAction Hub 数据仓库 / GoodAction Hub Data Repository -一个揭露**虚假开源人事物**的公共档案库。/ A public archive repository to expose fake open source people, things, and events. +本仓库是 [GoodAction Hub](https://github.com/GoodAction-Hub/GoodAction-Hub.github.io) 的独立数据仓库,用于存储公益慈善活动、会议和竞赛的结构化数据。 + +This repository is the standalone data repository for [GoodAction Hub](https://github.com/GoodAction-Hub/GoodAction-Hub.github.io), storing structured data for public welfare activities, conferences, and competitions. ## 功能入口 / Features -- [提交事件 / Submit Event][1] -- [审核列表 / Review List][2] -- [JSON API][3] +- [提交公益活动 / Submit Activity][1] +- [提交公益会议 / Submit Conference][2] +- [提交公益竞赛 / Submit Competition][3] + +## 如何添加活动数据 / How to Add Activity Data + +我们非常欢迎社区贡献!如果您发现有未收录的公益慈善会议、竞赛及活动,或者信息有误,请通过提交 Issue 或 Pull Request 的方式来帮助我们更新。 + +We warmly welcome community contributions! If you find unlisted public welfare conferences, competitions, or activities, or if there are any errors, please help us update by submitting an Issue or Pull Request. + +所有活动数据都存储在 `/data` 目录下的 YAML 文件中: + +- **会议 / Conferences**: 请添加到 `data/conferences.yml` +- **竞赛 / Competitions**: 请添加到 `data/competitions.yml` +- **活动 / Activities**: 请添加到 `data/activities.yml` + +## 数据结构 / Data Structure + +请在对应的 YAML 文件中,仿照以下格式添加新条目: -## 免责声明 / Disclaimer +```yaml +- title: 活动名称 (例如:第三届老龄志愿与公益服务学术论坛) + description: 探讨AI时代应对人口老龄化的新策略,推动我国老龄志愿与公益服务事业多元发展 + category: conference # 会议请使用 "conference",竞赛请使用 "competition",活动请使用 "activity" + tags: + - 老龄服务 + - 志愿公益 + - 人工智能 + - 学术论坛 + events: + - year: 2025 # 年份 + id: aging-volunteer-forum-2025 # 全局唯一的ID + link: https://mp.weixin.qq.com/s/qi9gF1ETgk6UvFnnGNSVlg # 链接 + timeline: + - deadline: '2025-10-19T23:59:00' # 关键日期 (ISO 8601 格式) + comment: '论文征集截止' # 日期说明 + - deadline: '2025-11-15T09:00:00' + comment: '学术年会开始' + - deadline: '2025-11-16T17:00:00' + comment: '学术年会结束' + timezone: Asia/Shanghai # 所在时区 + date: 2025年11月15日-11月16日 # 人类可读的日期范围 + place: 中国,北京 # 地点 +``` -- **隐私政策 / Privacy Policy**:施害过程中施害人暴露的个人信息不属于隐私,除此之外所有人均应受隐私保护。/ Personal information exposed by the perpetrator during the harmful process is not protected by privacy laws. Beyond that, all individuals should be protected by privacy rights. +**注意事项 / Notes:** -- **信息来源 / Information Source**:本平台仅提供基于 Git 的分布式信息存储,信息真实性由发布者负责,并由网友辨别、辟谣。/ This platform only provides decentralized information storage based on Git. The authenticity of information is the responsibility of the publisher, and is to be verified and fact-checked by the community. +- `category`: 必须是 `conference`、`competition` 或 `activity` +- `timeline.deadline`: 请使用 ISO 8601 标准格式 - `YYYY-MM-DDTHH:mm:ss` +- `timezone`: 请使用标准的 IANA 时区名称(例如 `Asia/Shanghai`),否则会影响时区转换 +- `date`: 请使用人类可读的单个日期或日期范围,如 `2025年4月30日` 或 `2025年4月30日-9月30日` +- `place`: 活动地址,如 `中国,上海`(`国家,城市`);如果是线上活动,直接写 `线上` -## 灵感来源 / Inspiration +💡 **新手友好提示**:如果您不熟悉 Pull Request 流程,也可以通过 Issues 方式提交活动信息,我们来帮您添加。 -- [FFmpeg shame](https://ffmpeg.org/shame.html) -- [996.icu](https://996.icu/) -- [Hax vs 360](https://github.com/hax/heshijun_v_360) +> 🎉 **每一份贡献都很珍贵,欢迎您的参与!** -[1]: https://github.com/BiYuanShe/Fake-Open-Source-wiki/issues/new?template=Fake-Open-Source-event.yml -[2]: https://github.com/BiYuanShe/Fake-Open-Source-wiki/pulls -[3]: https://biyuanshe.github.io/Fake-Open-Source-wiki/ +[1]: https://github.com/GoodAction-Hub/GoodAction-data/issues/new?template=activity.yml +[2]: https://github.com/GoodAction-Hub/GoodAction-data/issues/new?template=conference.yml +[3]: https://github.com/GoodAction-Hub/GoodAction-data/issues/new?template=competition.yml diff --git a/data/events.yml b/data/activities.yml similarity index 100% rename from data/events.yml rename to data/activities.yml diff --git a/data/competitions.yml b/data/competitions.yml new file mode 100644 index 0000000..e69de29 diff --git a/data/conferences.yml b/data/conferences.yml new file mode 100644 index 0000000..e69de29 From 2fedd18ddc7c2330f444df13f7d2f47ea9d84ff8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Mar 2026 18:12:36 +0000 Subject: [PATCH 3/9] Address PR review feedback: merge templates, add review/API links, simplify form fields Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/activity.yml | 52 +++++------ .github/ISSUE_TEMPLATE/competition.yml | 116 ------------------------- .github/ISSUE_TEMPLATE/conference.yml | 116 ------------------------- README.md | 12 ++- 4 files changed, 31 insertions(+), 265 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/competition.yml delete mode 100644 .github/ISSUE_TEMPLATE/conference.yml diff --git a/.github/ISSUE_TEMPLATE/activity.yml b/.github/ISSUE_TEMPLATE/activity.yml index 67df543..932fd8e 100644 --- a/.github/ISSUE_TEMPLATE/activity.yml +++ b/.github/ISSUE_TEMPLATE/activity.yml @@ -1,6 +1,6 @@ name: 提交公益活动 / Submit Activity -description: 提交一个公益活动信息,添加到 data/activities.yml / Submit a public welfare activity to be added to data/activities.yml -title: "[活动] 活动名称 / [Activity] Activity Title" +description: 提交一个公益活动、会议或竞赛 / Submit a public welfare activity, conference, or competition +title: "活动官方名称 / Official Activity Title" labels: - activity body: @@ -9,15 +9,19 @@ body: value: | ## 提交说明 / Submission Guidelines - 请参考 [数据结构说明](../blob/main/README.md#数据结构) 填写以下信息,您提交的活动将被添加到 `data/activities.yml`。 - Please refer to the [data structure documentation](../blob/main/README.md#数据结构) and fill in the following fields. Your submission will be added to `data/activities.yml`. + 提交后会自动创建 pull request 给开源社群审核,并由仓库维护者合并,再由自动化流水线更新到网站。 - - type: input - id: title + After submission, a pull request will be automatically created for open source community review, merged by repository maintainers, and then updated to the website by the automated pipeline. + + - type: dropdown + id: type attributes: - label: 活动名称 / Activity Title - description: 活动的完整名称 / Full name of the activity - placeholder: "例如:第三届老龄志愿与公益服务学术论坛 / Example: 3rd Academic Forum on Elderly Volunteering and Public Welfare Services" + label: 活动类型 / Activity Type + description: 请选择活动类型 / Please select the activity type + options: + - meetup + - conference + - competition validations: required: true @@ -66,32 +70,30 @@ body: validations: required: true - - type: textarea - id: timeline + - type: input + id: start_time attributes: - label: 关键时间节点 / Timeline - description: 每行一个时间节点,格式为"ISO 8601 日期 | 说明",例如"2025-10-19T23:59:00 | 报名截止" / One timeline entry per line, format "ISO 8601 date | comment" - placeholder: | - 2025-10-01T09:00:00 | 活动开始 / Activity starts - 2025-10-31T17:00:00 | 活动结束 / Activity ends + label: 开始时间 / Start Time + description: 活动开始的具体时间 / The specific date and time when the activity starts + placeholder: "例如:2025-10-01 09:00:00 / Example: 2025-10-01 09:00:00" validations: required: true - type: input - id: timezone + id: end_time attributes: - label: 时区 / Timezone - description: 请使用标准 IANA 时区名称 / Please use standard IANA timezone name - placeholder: "例如:Asia/Shanghai" + label: 结束时间 / End Time + description: 活动结束的具体时间 / The specific date and time when the activity ends + placeholder: "例如:2025-10-31 17:00:00 / Example: 2025-10-31 17:00:00" validations: required: true - type: input - id: date + id: timezone attributes: - label: 人类可读日期 / Human-readable Date - description: 人类可读的日期或日期范围 / Human-readable date or date range - placeholder: "例如:2025年10月1日 或 2025年10月1日-10月31日" + label: 时区 / Timezone + description: 请使用标准 IANA 时区名称 / Please use standard IANA timezone name + placeholder: "例如:Asia/Shanghai" validations: required: true @@ -111,5 +113,3 @@ body: options: - label: 提供的信息真实准确 / The information provided is truthful and accurate required: true - - label: 我已阅读数据结构说明 / I have read the data structure documentation - required: true diff --git a/.github/ISSUE_TEMPLATE/competition.yml b/.github/ISSUE_TEMPLATE/competition.yml deleted file mode 100644 index 80a9765..0000000 --- a/.github/ISSUE_TEMPLATE/competition.yml +++ /dev/null @@ -1,116 +0,0 @@ -name: 提交公益竞赛 / Submit Competition -description: 提交一个公益竞赛信息,添加到 data/competitions.yml / Submit a public welfare competition to be added to data/competitions.yml -title: "[竞赛] 竞赛名称 / [Competition] Competition Title" -labels: - - competition -body: - - type: markdown - attributes: - value: | - ## 提交说明 / Submission Guidelines - - 请参考 [数据结构说明](../blob/main/README.md#数据结构) 填写以下信息,您提交的竞赛将被添加到 `data/competitions.yml`。 - Please refer to the [data structure documentation](../blob/main/README.md#数据结构) and fill in the following fields. Your submission will be added to `data/competitions.yml`. - - - type: input - id: title - attributes: - label: 竞赛名称 / Competition Title - description: 竞赛的完整名称 / Full name of the competition - placeholder: "例如:第五届"创新杯"中国高校ESG案例大赛 / Example: 5th Innovation Cup China University ESG Case Competition" - validations: - required: true - - - type: textarea - id: description - attributes: - label: 竞赛简介 / Competition Description - description: 竞赛的简要介绍 / Brief description of the competition - placeholder: "请描述竞赛的主要内容、参赛资格和意义 / Please describe the main content, eligibility, and significance of the competition" - validations: - required: true - - - type: input - id: tags - attributes: - label: 分类标签 / Tags - description: 请用英文逗号分隔多个标签 / Please use commas to separate multiple tags - placeholder: "例如:ESG, 案例大赛, 高校竞赛, 可持续发展 / Example: ESG, 案例大赛, 高校竞赛" - validations: - required: true - - - type: input - id: year - attributes: - label: 年份 / Year - description: 竞赛举办年份 / Year the competition takes place - placeholder: "例如:2025" - validations: - required: true - - - type: input - id: id - attributes: - label: 唯一 ID / Unique ID - description: 竞赛的全局唯一标识符,建议使用英文小写和连字符 / Globally unique identifier for the competition, use lowercase English and hyphens - placeholder: "例如:innovation-cup-esg-case-2025" - validations: - required: true - - - type: input - id: link - attributes: - label: 竞赛链接 / Competition Link - description: 竞赛的官方链接或详情页面 / Official link or detail page of the competition - placeholder: "例如:https://mp.weixin.qq.com/s/... / Example: https://example.com/competition" - validations: - required: true - - - type: textarea - id: timeline - attributes: - label: 关键时间节点 / Timeline - description: 每行一个时间节点,格式为"ISO 8601 日期 | 说明",例如"2025-09-01T00:00:00 | 报名开始" / One timeline entry per line, format "ISO 8601 date | comment" - placeholder: | - 2025-09-01T00:00:00 | 报名开始 / Registration starts - 2025-10-31T23:59:00 | 作品提交截止 / Submission deadline - 2025-12-01T09:00:00 | 颁奖典礼 / Award ceremony - validations: - required: true - - - type: input - id: timezone - attributes: - label: 时区 / Timezone - description: 请使用标准 IANA 时区名称 / Please use standard IANA timezone name - placeholder: "例如:Asia/Shanghai" - validations: - required: true - - - type: input - id: date - attributes: - label: 人类可读日期 / Human-readable Date - description: 人类可读的日期或日期范围 / Human-readable date or date range - placeholder: "例如:2025年9月1日 或 2025年9月1日-12月1日" - validations: - required: true - - - type: input - id: place - attributes: - label: 竞赛地点 / Place - description: 竞赛地点,线上竞赛直接填写"线上" / Location of the competition; write "线上" for online competitions - placeholder: "例如:中国,北京 或 线上 / Example: 中国,北京 or 线上" - validations: - required: true - - - type: checkboxes - id: confirmation - attributes: - label: 我确认 / I Confirm - options: - - label: 提供的信息真实准确 / The information provided is truthful and accurate - required: true - - label: 我已阅读数据结构说明 / I have read the data structure documentation - required: true diff --git a/.github/ISSUE_TEMPLATE/conference.yml b/.github/ISSUE_TEMPLATE/conference.yml deleted file mode 100644 index a85b8aa..0000000 --- a/.github/ISSUE_TEMPLATE/conference.yml +++ /dev/null @@ -1,116 +0,0 @@ -name: 提交公益会议 / Submit Conference -description: 提交一个公益会议信息,添加到 data/conferences.yml / Submit a public welfare conference to be added to data/conferences.yml -title: "[会议] 会议名称 / [Conference] Conference Title" -labels: - - conference -body: - - type: markdown - attributes: - value: | - ## 提交说明 / Submission Guidelines - - 请参考 [数据结构说明](../blob/main/README.md#数据结构) 填写以下信息,您提交的会议将被添加到 `data/conferences.yml`。 - Please refer to the [data structure documentation](../blob/main/README.md#数据结构) and fill in the following fields. Your submission will be added to `data/conferences.yml`. - - - type: input - id: title - attributes: - label: 会议名称 / Conference Title - description: 会议的完整名称 / Full name of the conference - placeholder: "例如:第六届公益慈善理论与政策研讨会 / Example: 6th Seminar on Charity Theory and Policy" - validations: - required: true - - - type: textarea - id: description - attributes: - label: 会议简介 / Conference Description - description: 会议的简要介绍 / Brief description of the conference - placeholder: "请描述会议的主要议题、目的和意义 / Please describe the main topics, purpose, and significance of the conference" - validations: - required: true - - - type: input - id: tags - attributes: - label: 分类标签 / Tags - description: 请用英文逗号分隔多个标签 / Please use commas to separate multiple tags - placeholder: "例如:公益慈善, 理论研究, 政策研讨, 社会保障 / Example: 公益慈善, 理论研究, 政策研讨" - validations: - required: true - - - type: input - id: year - attributes: - label: 年份 / Year - description: 会议举办年份 / Year the conference takes place - placeholder: "例如:2025" - validations: - required: true - - - type: input - id: id - attributes: - label: 唯一 ID / Unique ID - description: 会议的全局唯一标识符,建议使用英文小写和连字符 / Globally unique identifier for the conference, use lowercase English and hyphens - placeholder: "例如:charity-theory-policy-conference-2025" - validations: - required: true - - - type: input - id: link - attributes: - label: 会议链接 / Conference Link - description: 会议的官方链接或详情页面 / Official link or detail page of the conference - placeholder: "例如:https://mp.weixin.qq.com/s/... / Example: https://example.com/conference" - validations: - required: true - - - type: textarea - id: timeline - attributes: - label: 关键时间节点 / Timeline - description: 每行一个时间节点,格式为"ISO 8601 日期 | 说明",例如"2025-10-31T23:59:00 | 论文投稿截止" / One timeline entry per line, format "ISO 8601 date | comment" - placeholder: | - 2025-10-31T23:59:00 | 论文投稿截止 / Paper submission deadline - 2025-12-06T09:00:00 | 会议开始 / Conference starts - 2025-12-07T17:00:00 | 会议结束 / Conference ends - validations: - required: true - - - type: input - id: timezone - attributes: - label: 时区 / Timezone - description: 请使用标准 IANA 时区名称 / Please use standard IANA timezone name - placeholder: "例如:Asia/Shanghai" - validations: - required: true - - - type: input - id: date - attributes: - label: 人类可读日期 / Human-readable Date - description: 人类可读的日期或日期范围 / Human-readable date or date range - placeholder: "例如:2025年12月6日 或 2025年12月6日-12月7日" - validations: - required: true - - - type: input - id: place - attributes: - label: 会议地点 / Place - description: 会议地点,线上会议直接填写"线上" / Location of the conference; write "线上" for online conferences - placeholder: "例如:中国,北京 或 线上 / Example: 中国,北京 or 线上" - validations: - required: true - - - type: checkboxes - id: confirmation - attributes: - label: 我确认 / I Confirm - options: - - label: 提供的信息真实准确 / The information provided is truthful and accurate - required: true - - label: 我已阅读数据结构说明 / I have read the data structure documentation - required: true diff --git a/README.md b/README.md index d323730..b1b2a9d 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@ This repository is the standalone data repository for [GoodAction Hub](https://g ## 功能入口 / Features -- [提交公益活动 / Submit Activity][1] -- [提交公益会议 / Submit Conference][2] -- [提交公益竞赛 / Submit Competition][3] +- [提交活动 / Submit Activity][1] +- [审核列表 / Review List][2] +- [JSON API][3] ## 如何添加活动数据 / How to Add Activity Data @@ -47,7 +47,6 @@ We warmly welcome community contributions! If you find unlisted public welfare c - deadline: '2025-11-16T17:00:00' comment: '学术年会结束' timezone: Asia/Shanghai # 所在时区 - date: 2025年11月15日-11月16日 # 人类可读的日期范围 place: 中国,北京 # 地点 ``` @@ -56,7 +55,6 @@ We warmly welcome community contributions! If you find unlisted public welfare c - `category`: 必须是 `conference`、`competition` 或 `activity` - `timeline.deadline`: 请使用 ISO 8601 标准格式 - `YYYY-MM-DDTHH:mm:ss` - `timezone`: 请使用标准的 IANA 时区名称(例如 `Asia/Shanghai`),否则会影响时区转换 -- `date`: 请使用人类可读的单个日期或日期范围,如 `2025年4月30日` 或 `2025年4月30日-9月30日` - `place`: 活动地址,如 `中国,上海`(`国家,城市`);如果是线上活动,直接写 `线上` 💡 **新手友好提示**:如果您不熟悉 Pull Request 流程,也可以通过 Issues 方式提交活动信息,我们来帮您添加。 @@ -64,5 +62,5 @@ We warmly welcome community contributions! If you find unlisted public welfare c > 🎉 **每一份贡献都很珍贵,欢迎您的参与!** [1]: https://github.com/GoodAction-Hub/GoodAction-data/issues/new?template=activity.yml -[2]: https://github.com/GoodAction-Hub/GoodAction-data/issues/new?template=conference.yml -[3]: https://github.com/GoodAction-Hub/GoodAction-data/issues/new?template=competition.yml +[2]: https://github.com/GoodAction-Hub/GoodAction-data/pulls +[3]: https://goodaction-hub.github.io/GoodAction-data/ From 9efcdd5b3e9ae5ffdb9f264762df19a234fff519 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Mar 2026 18:30:20 +0000 Subject: [PATCH 4/9] Update README and activity.yml: single data file, start/end time, beginner hint first, inspiration section Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/activity.yml | 9 ------- README.md | 40 ++++++++++++++--------------- 2 files changed, 19 insertions(+), 30 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/activity.yml b/.github/ISSUE_TEMPLATE/activity.yml index 932fd8e..1785641 100644 --- a/.github/ISSUE_TEMPLATE/activity.yml +++ b/.github/ISSUE_TEMPLATE/activity.yml @@ -43,15 +43,6 @@ body: validations: required: true - - type: input - id: year - attributes: - label: 年份 / Year - description: 活动举办年份 / Year the activity takes place - placeholder: "例如:2025" - validations: - required: true - - type: input id: id attributes: diff --git a/README.md b/README.md index b1b2a9d..0642dd6 100644 --- a/README.md +++ b/README.md @@ -12,55 +12,53 @@ This repository is the standalone data repository for [GoodAction Hub](https://g ## 如何添加活动数据 / How to Add Activity Data -我们非常欢迎社区贡献!如果您发现有未收录的公益慈善会议、竞赛及活动,或者信息有误,请通过提交 Issue 或 Pull Request 的方式来帮助我们更新。 +💡 **新手友好**:推荐通过上方功能入口的"[提交活动][1]"链接来提交,填写表单即可,无需了解 Git 操作。 -We warmly welcome community contributions! If you find unlisted public welfare conferences, competitions, or activities, or if there are any errors, please help us update by submitting an Issue or Pull Request. +💡 **Beginner-friendly**: It is recommended to submit via the "[Submit Activity][1]" link above — just fill in a form, no Git knowledge needed. -所有活动数据都存储在 `/data` 目录下的 YAML 文件中: +所有活动数据都存储在 `data/activities.yml` 中,`category` 字段区分类型(`meetup`、`conference`、`competition`)。 -- **会议 / Conferences**: 请添加到 `data/conferences.yml` -- **竞赛 / Competitions**: 请添加到 `data/competitions.yml` -- **活动 / Activities**: 请添加到 `data/activities.yml` +All activity data is stored in `data/activities.yml`, with the `category` field distinguishing the type (`meetup`, `conference`, `competition`). + +如果您熟悉 Git 和 Pull Request 流程,也可以直接编辑 `data/activities.yml` 并提交 Pull Request。 + +If you are familiar with Git and Pull Requests, you can also directly edit `data/activities.yml` and submit a Pull Request. ## 数据结构 / Data Structure -请在对应的 YAML 文件中,仿照以下格式添加新条目: +请在 `data/activities.yml` 中,仿照以下格式添加新条目: ```yaml - title: 活动名称 (例如:第三届老龄志愿与公益服务学术论坛) description: 探讨AI时代应对人口老龄化的新策略,推动我国老龄志愿与公益服务事业多元发展 - category: conference # 会议请使用 "conference",竞赛请使用 "competition",活动请使用 "activity" + category: conference # meetup | conference | competition tags: - 老龄服务 - 志愿公益 - 人工智能 - 学术论坛 events: - - year: 2025 # 年份 - id: aging-volunteer-forum-2025 # 全局唯一的ID + - id: aging-volunteer-forum-2025 # 全局唯一的ID link: https://mp.weixin.qq.com/s/qi9gF1ETgk6UvFnnGNSVlg # 链接 - timeline: - - deadline: '2025-10-19T23:59:00' # 关键日期 (ISO 8601 格式) - comment: '论文征集截止' # 日期说明 - - deadline: '2025-11-15T09:00:00' - comment: '学术年会开始' - - deadline: '2025-11-16T17:00:00' - comment: '学术年会结束' + start_time: '2025-11-15 09:00:00' # 开始时间 + end_time: '2025-11-16 17:00:00' # 结束时间 timezone: Asia/Shanghai # 所在时区 place: 中国,北京 # 地点 ``` **注意事项 / Notes:** -- `category`: 必须是 `conference`、`competition` 或 `activity` -- `timeline.deadline`: 请使用 ISO 8601 标准格式 - `YYYY-MM-DDTHH:mm:ss` +- `category`: 必须是 `meetup`、`conference` 或 `competition` +- `start_time` / `end_time`: 格式为 `YYYY-MM-DD HH:mm:ss` - `timezone`: 请使用标准的 IANA 时区名称(例如 `Asia/Shanghai`),否则会影响时区转换 - `place`: 活动地址,如 `中国,上海`(`国家,城市`);如果是线上活动,直接写 `线上` -💡 **新手友好提示**:如果您不熟悉 Pull Request 流程,也可以通过 Issues 方式提交活动信息,我们来帮您添加。 - > 🎉 **每一份贡献都很珍贵,欢迎您的参与!** +## 灵感来源 / Inspiration + +- [GoodAction-Hub/GoodAction-Hub.github.io](https://github.com/GoodAction-Hub/GoodAction-Hub.github.io) + [1]: https://github.com/GoodAction-Hub/GoodAction-data/issues/new?template=activity.yml [2]: https://github.com/GoodAction-Hub/GoodAction-data/pulls [3]: https://goodaction-hub.github.io/GoodAction-data/ From e418d443679a75a0acf87eb87fbef145427a96cc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Mar 2026 18:45:07 +0000 Subject: [PATCH 5/9] Restore timeline field, rewrite save-event.sh with Markdown table parser, update workflow Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/activity.yml | 11 ++++ .github/scripts/save-event.sh | 90 ++++++++++++++++++----------- .github/workflows/deploy-data.yml | 2 +- .github/workflows/submit-event.yml | 28 ++++----- README.md | 10 +++- 5 files changed, 91 insertions(+), 50 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/activity.yml b/.github/ISSUE_TEMPLATE/activity.yml index 1785641..2587d1a 100644 --- a/.github/ISSUE_TEMPLATE/activity.yml +++ b/.github/ISSUE_TEMPLATE/activity.yml @@ -79,6 +79,17 @@ body: validations: required: true + - type: textarea + id: timeline + attributes: + label: 活动日程 / Timeline + description: 活动各环节的关键时间节点,使用 Markdown 表格格式 / Key milestones of the activity in Markdown table format + placeholder: | + | 关键日期 / Deadline | 说明 / Description | + | --- | --- | + | 2025-10-19T23:59:00 | 论文征集截止 | + | 2025-11-15T09:00:00 | 学术年会开始 | + - type: input id: timezone attributes: diff --git a/.github/scripts/save-event.sh b/.github/scripts/save-event.sh index 860abe9..f1e8fee 100644 --- a/.github/scripts/save-event.sh +++ b/.github/scripts/save-event.sh @@ -7,59 +7,79 @@ yaml_escape() { append_yaml_split_array() { local file_path="$1" - local key="$2" - local value="$3" + local indent="$2" + local key="$3" + local value="$4" local has_items=0 - printf ' %s:\n' "$key" >> "$file_path" + printf '%s%s:\n' "$indent" "$key" >> "$file_path" while IFS= read -r item; do if [ -n "$item" ]; then has_items=1 - printf ' - "%s"\n' "$(yaml_escape "$item")" >> "$file_path" + printf '%s - "%s"\n' "$indent" "$(yaml_escape "$item")" >> "$file_path" fi done < <(printf '%s' "$value" | awk 'BEGIN{FS="[,,[:space:]]+"} {for (i=1; i<=NF; i++) if ($i != "") print $i}') if [ "$has_items" -eq 0 ]; then - printf ' []\n' >> "$file_path" + printf '%s []\n' "$indent" >> "$file_path" fi } -START_TIME="${EVENT_START_TIME:-}" -DATE_PART=$(echo "$START_TIME" | grep -oE '[0-9]{4}[-/][0-9]{2}[-/][0-9]{2}' | head -n1 | tr '/' '-') +# Parse a Markdown table into YAML timeline entries. +# Expected table format (header row + separator row + data rows): +# | 关键日期 / Deadline | 说明 / Description | +# | --- | --- | +# | 2025-10-19T23:59:00 | 论文征集截止 | +append_yaml_timeline() { + local file_path="$1" + local table="$2" + local has_rows=0 + + while IFS= read -r line; do + # Only process lines that look like table rows + [[ "$line" =~ ^\| ]] || continue + # Skip separator rows (e.g. | --- | --- |) + [[ "$line" =~ ^\|[[:space:]]*-+[[:space:]]*\| ]] && continue + + local deadline comment + deadline=$(printf '%s' "$line" | awk -F'|' '{gsub(/^[[:space:]]+|[[:space:]]+$/, "", $2); print $2}') + comment=$(printf '%s' "$line" | awk -F'|' '{gsub(/^[[:space:]]+|[[:space:]]+$/, "", $3); print $3}') + + # Skip header rows (deadline column starts with a digit for valid ISO date entries) + [[ "$deadline" =~ ^[0-9] ]] || continue -if [ -z "$DATE_PART" ]; then - echo "Unable to parse start_time: $START_TIME" - exit 1 -fi + if [ "$has_rows" -eq 0 ]; then + printf ' timeline:\n' >> "$file_path" + fi + has_rows=1 + printf ' - deadline: "%s"\n' "$(yaml_escape "$deadline")" >> "$file_path" + printf ' comment: "%s"\n' "$(yaml_escape "$comment")" >> "$file_path" + done <<< "$table" +} -IFS='-' read -r YEAR MONTH DAY <<< "$DATE_PART" +ACTIVITIES_FILE="${ACTIVITIES_FILE_PATH:-data/activities.yml}" -SAFE_TITLE=$(echo "${ISSUE_TITLE:-}" | \ - sed 's#[\\/:*?"<>|]#-#g; s/[[:space:]]\+/-/g; s/--\+/-/g; s/^-//; s/-$//') +{ + printf -- '- title: "%s"\n' "$(yaml_escape "${ISSUE_TITLE:-}")" + printf ' category: "%s"\n' "$(yaml_escape "${ACTIVITY_TYPE:-}")" + printf ' description: "%s"\n' "$(yaml_escape "${ACTIVITY_DESCRIPTION:-}")" +} >> "$ACTIVITIES_FILE" -if [ -z "$SAFE_TITLE" ]; then - SAFE_TITLE="issue-${ISSUE_NUMBER:-unknown}" -fi +append_yaml_split_array "$ACTIVITIES_FILE" " " "tags" "${ACTIVITY_TAGS:-}" -FILE_PATH="data/$YEAR/$MONTH/$DAY/$SAFE_TITLE.md" -EVENTS_FILE="${EVENTS_FILE_PATH:-data/events.yml}" -mkdir -p "$(dirname "$FILE_PATH")" { - printf '# %s\n\n' "${ISSUE_TITLE:-}" - printf '%s\n' "${ISSUE_BODY:-}" -} > "$FILE_PATH" + printf ' events:\n' + printf ' - id: "%s"\n' "$(yaml_escape "${ACTIVITY_ID:-}")" + printf ' link: "%s"\n' "$(yaml_escape "${ACTIVITY_LINK:-}")" + printf ' start_time: "%s"\n' "$(yaml_escape "${ACTIVITY_START_TIME:-}")" + printf ' end_time: "%s"\n' "$(yaml_escape "${ACTIVITY_END_TIME:-}")" +} >> "$ACTIVITIES_FILE" + +append_yaml_timeline "$ACTIVITIES_FILE" "${ACTIVITY_TIMELINE:-}" { - printf -- '- issue_link: "%s"\n' "$(yaml_escape "${ISSUE_LINK:-}")" - printf ' file_path: "%s"\n' "$(yaml_escape "$FILE_PATH")" - printf ' title: "%s"\n' "$(yaml_escape "${ISSUE_TITLE:-}")" - printf ' start_time: "%s"\n' "$(yaml_escape "${EVENT_START_TIME:-}")" - printf ' end_time: "%s"\n' "$(yaml_escape "${EVENT_END_TIME:-}")" - printf ' location: "%s"\n' "$(yaml_escape "${EVENT_LOCATION:-}")" - printf ' money: "%s"\n' "$(yaml_escape "${EVENT_MONEY:-}")" - printf ' whistleblower: "%s"\n' "$(yaml_escape "${EVENT_WHISTLEBLOWER:-}")" -} >> "$EVENTS_FILE" - -append_yaml_split_array "$EVENTS_FILE" "hypocrite" "${EVENT_HYPOCRITE:-}" -append_yaml_split_array "$EVENTS_FILE" "tags" "${EVENT_TAGS:-}" + printf ' timezone: "%s"\n' "$(yaml_escape "${ACTIVITY_TIMEZONE:-}")" + printf ' place: "%s"\n' "$(yaml_escape "${ACTIVITY_PLACE:-}")" + printf ' issue_link: "%s"\n' "$(yaml_escape "${ISSUE_LINK:-}")" +} >> "$ACTIVITIES_FILE" diff --git a/.github/workflows/deploy-data.yml b/.github/workflows/deploy-data.yml index 5a19918..aa4d823 100644 --- a/.github/workflows/deploy-data.yml +++ b/.github/workflows/deploy-data.yml @@ -24,7 +24,7 @@ jobs: echo $( ls -1 *.yml 2>/dev/null | \ sed 's/\.yml$//' | nl | \ - sed 's/^[[:space:]]*\([0-9]*\)[[:space:]]*\(.*\)$/\1. [\2](https:\/\/biyuanshe.github.io\/Fake-Open-Source-wiki\/\2.json)/' + sed 's/^[[:space:]]*\([0-9]*\)[[:space:]]*\(.*\)$/\1. [\2](https:\/\/goodaction-hub.github.io\/GoodAction-data\/\2.json)/' ) >> index.md cd - diff --git a/.github/workflows/submit-event.yml b/.github/workflows/submit-event.yml index fdc7069..17bf1fa 100644 --- a/.github/workflows/submit-event.yml +++ b/.github/workflows/submit-event.yml @@ -1,4 +1,4 @@ -name: Fake Open Source event saving +name: Activity submission on: issues: @@ -8,7 +8,7 @@ on: jobs: store: runs-on: ubuntu-latest - if: "contains(github.event.issue.labels.*.name, 'event')" + if: "contains(github.event.issue.labels.*.name, 'activity')" permissions: contents: write steps: @@ -17,25 +17,27 @@ jobs: - id: issue-parser uses: stefanbuck/github-issue-parser@v3 with: - template-path: ".github/ISSUE_TEMPLATE/Fake-Open-Source-event.yml" + template-path: ".github/ISSUE_TEMPLATE/activity.yml" - - name: Save issue to Markdown & YAML + - name: Save activity to YAML env: ISSUE_NUMBER: ${{ github.event.issue.number }} ISSUE_LINK: ${{ github.event.issue.html_url }} ISSUE_TITLE: ${{ github.event.issue.title }} - ISSUE_BODY: ${{ github.event.issue.body }} - EVENT_TAGS: ${{ steps.issue-parser.outputs.issueparser_tags }} - EVENT_START_TIME: ${{ steps.issue-parser.outputs.issueparser_start_time }} - EVENT_END_TIME: ${{ steps.issue-parser.outputs.issueparser_end_time }} - EVENT_LOCATION: ${{ steps.issue-parser.outputs.issueparser_location }} - EVENT_WHISTLEBLOWER: ${{ github.event.issue.user.html_url }} - EVENT_HYPOCRITE: ${{ steps.issue-parser.outputs.issueparser_hypocrite }} - EVENT_MONEY: ${{ steps.issue-parser.outputs.issueparser_money }} + ACTIVITY_TYPE: ${{ steps.issue-parser.outputs.issueparser_type }} + ACTIVITY_DESCRIPTION: ${{ steps.issue-parser.outputs.issueparser_description }} + ACTIVITY_TAGS: ${{ steps.issue-parser.outputs.issueparser_tags }} + ACTIVITY_ID: ${{ steps.issue-parser.outputs.issueparser_id }} + ACTIVITY_LINK: ${{ steps.issue-parser.outputs.issueparser_link }} + ACTIVITY_START_TIME: ${{ steps.issue-parser.outputs.issueparser_start_time }} + ACTIVITY_END_TIME: ${{ steps.issue-parser.outputs.issueparser_end_time }} + ACTIVITY_TIMELINE: ${{ steps.issue-parser.outputs.issueparser_timeline }} + ACTIVITY_TIMEZONE: ${{ steps.issue-parser.outputs.issueparser_timezone }} + ACTIVITY_PLACE: ${{ steps.issue-parser.outputs.issueparser_place }} run: | bash .github/scripts/save-event.sh - uses: peter-evans/create-pull-request@v8 with: - title: "docs(event): add data of ${{ github.event.issue.title }}" + title: "data(activity): add ${{ github.event.issue.title }}" body: "fix #${{ github.event.issue.number }}" diff --git a/README.md b/README.md index 0642dd6..26a1c9b 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,13 @@ If you are familiar with Git and Pull Requests, you can also directly edit `data link: https://mp.weixin.qq.com/s/qi9gF1ETgk6UvFnnGNSVlg # 链接 start_time: '2025-11-15 09:00:00' # 开始时间 end_time: '2025-11-16 17:00:00' # 结束时间 + timeline: + - deadline: '2025-10-19T23:59:00' # 关键日期 (ISO 8601 格式) + comment: '论文征集截止' # 日期说明 + - deadline: '2025-11-15T09:00:00' + comment: '学术年会开始' + - deadline: '2025-11-16T17:00:00' + comment: '学术年会结束' timezone: Asia/Shanghai # 所在时区 place: 中国,北京 # 地点 ``` @@ -49,7 +56,8 @@ If you are familiar with Git and Pull Requests, you can also directly edit `data **注意事项 / Notes:** - `category`: 必须是 `meetup`、`conference` 或 `competition` -- `start_time` / `end_time`: 格式为 `YYYY-MM-DD HH:mm:ss` +- `start_time` / `end_time`: 活动整体的开始和结束时间,格式为 `YYYY-MM-DD HH:mm:ss` +- `timeline.deadline`: 每个环节的关键时间节点,请使用 ISO 8601 标准格式 - `YYYY-MM-DDTHH:mm:ss` - `timezone`: 请使用标准的 IANA 时区名称(例如 `Asia/Shanghai`),否则会影响时区转换 - `place`: 活动地址,如 `中国,上海`(`国家,城市`);如果是线上活动,直接写 `线上` From 4a6189201122218fb3f13faa600189be4a9d85b5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Mar 2026 18:56:57 +0000 Subject: [PATCH 6/9] Add restaurant form+workflow, fix Inspiration link, change timeline to default value Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/activity.yml | 2 +- .github/ISSUE_TEMPLATE/restaurant.yml | 86 +++++++++++++++++++++++++ .github/scripts/save-restaurant.sh | 46 +++++++++++++ .github/settings.yml | 4 ++ .github/workflows/submit-restaurant.yml | 41 ++++++++++++ README.md | 40 +++++++++++- data/restaurants.yml | 0 7 files changed, 217 insertions(+), 2 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/restaurant.yml create mode 100644 .github/scripts/save-restaurant.sh create mode 100644 .github/workflows/submit-restaurant.yml create mode 100644 data/restaurants.yml diff --git a/.github/ISSUE_TEMPLATE/activity.yml b/.github/ISSUE_TEMPLATE/activity.yml index 2587d1a..4704bda 100644 --- a/.github/ISSUE_TEMPLATE/activity.yml +++ b/.github/ISSUE_TEMPLATE/activity.yml @@ -84,7 +84,7 @@ body: attributes: label: 活动日程 / Timeline description: 活动各环节的关键时间节点,使用 Markdown 表格格式 / Key milestones of the activity in Markdown table format - placeholder: | + value: | | 关键日期 / Deadline | 说明 / Description | | --- | --- | | 2025-10-19T23:59:00 | 论文征集截止 | diff --git a/.github/ISSUE_TEMPLATE/restaurant.yml b/.github/ISSUE_TEMPLATE/restaurant.yml new file mode 100644 index 0000000..6053368 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/restaurant.yml @@ -0,0 +1,86 @@ +name: 提交无障碍友好餐厅 / Submit Accessible Restaurant +description: 提交一家无障碍友好的餐厅 / Submit an accessibility-friendly restaurant +title: "餐厅官方名称 / Official Restaurant Name" +labels: + - restaurant +body: + - type: markdown + attributes: + value: | + ## 提交说明 / Submission Guidelines + + 提交后会自动创建 pull request 给开源社群审核,并由仓库维护者合并,再由自动化流水线更新到网站。 + + After submission, a pull request will be automatically created for open source community review, merged by repository maintainers, and then updated to the website by the automated pipeline. + + - type: input + id: id + attributes: + label: 唯一 ID / Unique ID + description: 餐厅的全局唯一标识符,建议使用英文小写和连字符 / Globally unique identifier, use lowercase English and hyphens + placeholder: "例如:aimer-coffee-shanghai" + validations: + required: true + + - type: textarea + id: description + attributes: + label: 餐厅简介 / Description + description: 餐厅的简要介绍 / Brief description of the restaurant + placeholder: "请描述餐厅的特色与无障碍友好服务 / Please describe the restaurant's features and accessibility services" + validations: + required: true + + - type: input + id: features + attributes: + label: 无障碍特色服务 / Accessibility Features + description: 请用英文逗号分隔多个特色服务 / Please use commas to separate multiple features + placeholder: "例如:手语服务, 无障碍通道, 盲文菜单 / Example: 手语服务, 无障碍通道, 盲文菜单" + validations: + required: true + + - type: input + id: food + attributes: + label: 特色美食 / Specialty Food + description: 餐厅的招牌菜品或饮品 / Signature dishes or drinks + placeholder: "例如:咖啡、甜品 / Example: 咖啡、甜品" + + - type: input + id: value + attributes: + label: 社会价值 / Social Value + description: 餐厅的社会价值或人均消费等 / Social value of the restaurant or average spend + placeholder: "例如:提供残障友好服务与就业机会 / Example: 提供残障友好服务与就业机会" + + - type: input + id: address + attributes: + label: 地址 / Address + description: 餐厅的详细地址 / Detailed address of the restaurant + placeholder: "例如:上海市静安区示例路1号 / Example: 上海市静安区示例路1号" + validations: + required: true + + - type: input + id: lat + attributes: + label: 纬度 / Latitude + description: 餐厅的 GPS 纬度坐标(可从地图应用获取)/ GPS latitude coordinate (can be obtained from map apps) + placeholder: "例如:31.2304" + + - type: input + id: lng + attributes: + label: 经度 / Longitude + description: 餐厅的 GPS 经度坐标(可从地图应用获取)/ GPS longitude coordinate (can be obtained from map apps) + placeholder: "例如:121.4737" + + - type: checkboxes + id: confirmation + attributes: + label: 我确认 / I Confirm + options: + - label: 提供的信息真实准确 / The information provided is truthful and accurate + required: true diff --git a/.github/scripts/save-restaurant.sh b/.github/scripts/save-restaurant.sh new file mode 100644 index 0000000..b2eb193 --- /dev/null +++ b/.github/scripts/save-restaurant.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +set -euo pipefail + +yaml_escape() { + printf '%s' "$1" | sed 's/\\/\\\\/g; s/"/\\"/g' +} + +append_yaml_split_array() { + local file_path="$1" + local indent="$2" + local key="$3" + local value="$4" + local has_items=0 + + printf '%s%s:\n' "$indent" "$key" >> "$file_path" + + while IFS= read -r item; do + if [ -n "$item" ]; then + has_items=1 + printf '%s - "%s"\n' "$indent" "$(yaml_escape "$item")" >> "$file_path" + fi + done < <(printf '%s' "$value" | awk 'BEGIN{FS="[,,[:space:]]+"} {for (i=1; i<=NF; i++) if ($i != "") print $i}') + + if [ "$has_items" -eq 0 ]; then + printf '%s []\n' "$indent" >> "$file_path" + fi +} + +RESTAURANTS_FILE="${RESTAURANTS_FILE_PATH:-data/restaurants.yml}" + +{ + printf -- '- id: "%s"\n' "$(yaml_escape "${RESTAURANT_ID:-}")" + printf ' name: "%s"\n' "$(yaml_escape "${ISSUE_TITLE:-}")" + printf ' description: "%s"\n' "$(yaml_escape "${RESTAURANT_DESCRIPTION:-}")" +} >> "$RESTAURANTS_FILE" + +append_yaml_split_array "$RESTAURANTS_FILE" " " "features" "${RESTAURANT_FEATURES:-}" + +{ + printf ' food: "%s"\n' "$(yaml_escape "${RESTAURANT_FOOD:-}")" + printf ' value: "%s"\n' "$(yaml_escape "${RESTAURANT_VALUE:-}")" + printf ' address: "%s"\n' "$(yaml_escape "${RESTAURANT_ADDRESS:-}")" + printf ' lat: "%s"\n' "$(yaml_escape "${RESTAURANT_LAT:-}")" + printf ' lng: "%s"\n' "$(yaml_escape "${RESTAURANT_LNG:-}")" + printf ' issue_link: "%s"\n' "$(yaml_escape "${ISSUE_LINK:-}")" +} >> "$RESTAURANTS_FILE" diff --git a/.github/settings.yml b/.github/settings.yml index bc5278e..4393034 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -60,6 +60,10 @@ labels: color: "#e4e669" description: Public welfare competition / 公益竞赛 + - name: restaurant + color: "#fbca04" + description: Accessible restaurant / 无障碍友好餐厅 + branches: - name: main # https://docs.github.com/en/rest/reference/repos#update-branch-protection diff --git a/.github/workflows/submit-restaurant.yml b/.github/workflows/submit-restaurant.yml new file mode 100644 index 0000000..9d0285d --- /dev/null +++ b/.github/workflows/submit-restaurant.yml @@ -0,0 +1,41 @@ +name: Restaurant submission + +on: + issues: + types: + - opened + +jobs: + store: + runs-on: ubuntu-latest + if: "contains(github.event.issue.labels.*.name, 'restaurant')" + permissions: + contents: write + steps: + - uses: actions/checkout@v6 + + - id: issue-parser + uses: stefanbuck/github-issue-parser@v3 + with: + template-path: ".github/ISSUE_TEMPLATE/restaurant.yml" + + - name: Save restaurant to YAML + env: + ISSUE_NUMBER: ${{ github.event.issue.number }} + ISSUE_LINK: ${{ github.event.issue.html_url }} + ISSUE_TITLE: ${{ github.event.issue.title }} + RESTAURANT_ID: ${{ steps.issue-parser.outputs.issueparser_id }} + RESTAURANT_DESCRIPTION: ${{ steps.issue-parser.outputs.issueparser_description }} + RESTAURANT_FEATURES: ${{ steps.issue-parser.outputs.issueparser_features }} + RESTAURANT_FOOD: ${{ steps.issue-parser.outputs.issueparser_food }} + RESTAURANT_VALUE: ${{ steps.issue-parser.outputs.issueparser_value }} + RESTAURANT_ADDRESS: ${{ steps.issue-parser.outputs.issueparser_address }} + RESTAURANT_LAT: ${{ steps.issue-parser.outputs.issueparser_lat }} + RESTAURANT_LNG: ${{ steps.issue-parser.outputs.issueparser_lng }} + run: | + bash .github/scripts/save-restaurant.sh + + - uses: peter-evans/create-pull-request@v8 + with: + title: "data(restaurant): add ${{ github.event.issue.title }}" + body: "fix #${{ github.event.issue.number }}" diff --git a/README.md b/README.md index 26a1c9b..aee95a2 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ This repository is the standalone data repository for [GoodAction Hub](https://g ## 功能入口 / Features - [提交活动 / Submit Activity][1] +- [提交餐厅 / Submit Restaurant][4] - [审核列表 / Review List][2] - [JSON API][3] @@ -63,10 +64,47 @@ If you are familiar with Git and Pull Requests, you can also directly edit `data > 🎉 **每一份贡献都很珍贵,欢迎您的参与!** +## 如何添加餐厅数据 / How to Add Restaurant Data + +💡 **新手友好**:推荐通过上方功能入口的"[提交餐厅][4]"链接来提交,填写表单即可。 + +💡 **Beginner-friendly**: It is recommended to submit via the "[Submit Restaurant][4]" link above — just fill in a form. + +所有餐厅数据都存储在 `data/restaurants.yml` 中。 + +All restaurant data is stored in `data/restaurants.yml`. + +如果您熟悉 Git 和 Pull Request 流程,也可以直接编辑 `data/restaurants.yml` 并提交 Pull Request。 + +If you are familiar with Git and Pull Requests, you can also directly edit `data/restaurants.yml` and submit a Pull Request. + +## 餐厅数据结构 / Restaurant Data Structure + +请在 `data/restaurants.yml` 中,仿照以下格式添加新条目: + +```yaml +- id: aimer-coffee-shanghai # 全局唯一的 ID + name: 爱默咖啡 # 餐厅名称(即 Issue 标题) + description: 一家提供手语服务、无障碍通道的温暖咖啡馆 + features: + - 手语服务 + - 无障碍通道 + - 盲文菜单 + food: 咖啡、甜品 + value: 提供残障友好服务与就业机会 + address: 上海市静安区示例路1号 + lat: "31.2304" # GPS 纬度 + lng: "121.4737" # GPS 经度 + issue_link: https://github.com/GoodAction-Hub/GoodAction-data/issues/1 +``` + +> 🎉 **每一份贡献都很珍贵,欢迎您的参与!** + ## 灵感来源 / Inspiration -- [GoodAction-Hub/GoodAction-Hub.github.io](https://github.com/GoodAction-Hub/GoodAction-Hub.github.io) +- [BiYuanShe/Fake-Open-Source-wiki](https://github.com/BiYuanShe/Fake-Open-Source-wiki) [1]: https://github.com/GoodAction-Hub/GoodAction-data/issues/new?template=activity.yml [2]: https://github.com/GoodAction-Hub/GoodAction-data/pulls [3]: https://goodaction-hub.github.io/GoodAction-data/ +[4]: https://github.com/GoodAction-Hub/GoodAction-data/issues/new?template=restaurant.yml diff --git a/data/restaurants.yml b/data/restaurants.yml new file mode 100644 index 0000000..e69de29 From 30d4d5a09edd715c95b6b8fc67fd202c5e1afc6f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Mar 2026 19:15:43 +0000 Subject: [PATCH 7/9] Refactor restaurant form, extract yaml_utils.sh, delete stale data files, restructure README Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/restaurant.yml | 31 ++++++++++--- .github/scripts/save-event.sh | 26 +---------- .github/scripts/save-restaurant.sh | 58 ++++++++++++++++--------- .github/scripts/yaml_utils.sh | 29 +++++++++++++ .github/workflows/submit-restaurant.yml | 3 +- README.md | 58 +++++++++++-------------- data/competitions.yml | 0 data/conferences.yml | 0 8 files changed, 120 insertions(+), 85 deletions(-) create mode 100644 .github/scripts/yaml_utils.sh delete mode 100644 data/competitions.yml delete mode 100644 data/conferences.yml diff --git a/.github/ISSUE_TEMPLATE/restaurant.yml b/.github/ISSUE_TEMPLATE/restaurant.yml index 6053368..3c0af36 100644 --- a/.github/ISSUE_TEMPLATE/restaurant.yml +++ b/.github/ISSUE_TEMPLATE/restaurant.yml @@ -40,19 +40,36 @@ body: validations: required: true - - type: input + - type: textarea id: food attributes: label: 特色美食 / Specialty Food - description: 餐厅的招牌菜品或饮品 / Signature dishes or drinks - placeholder: "例如:咖啡、甜品 / Example: 咖啡、甜品" + description: 餐厅的招牌菜品或饮品及价格,使用 Markdown 表格格式 / Signature dishes or drinks with prices in Markdown table format + value: | + | 品名 / Dish | 价格 / Price | + | --- | --- | + | 招牌咖啡 | ¥35 | + | 无障碍套餐 | ¥68 | - type: input - id: value + id: avg_spend attributes: - label: 社会价值 / Social Value - description: 餐厅的社会价值或人均消费等 / Social value of the restaurant or average spend - placeholder: "例如:提供残障友好服务与就业机会 / Example: 提供残障友好服务与就业机会" + label: 人均消费 / Average Spend + description: 餐厅的人均消费,请注明货币单位 / Average spend per person, please include currency unit + placeholder: "例如:¥50 / Example: ¥50" + + - type: checkboxes + id: social_values + attributes: + label: 无障碍社会价值 / Accessibility Social Values + description: 请选择该餐厅提供的无障碍相关价值 / Select the accessibility-related values this restaurant provides + options: + - label: 残障就业支持 / Disability employment support + - label: 无障碍通道 / Accessible entrance + - label: 无障碍洗手间 / Accessible restroom + - label: 手语服务 / Sign language service + - label: 盲文菜单 / Braille menu + - label: 特殊饮食需求支持 / Special dietary needs support - type: input id: address diff --git a/.github/scripts/save-event.sh b/.github/scripts/save-event.sh index f1e8fee..024b6d8 100644 --- a/.github/scripts/save-event.sh +++ b/.github/scripts/save-event.sh @@ -1,30 +1,8 @@ #!/usr/bin/env bash set -euo pipefail -yaml_escape() { - printf '%s' "$1" | sed 's/\\/\\\\/g; s/"/\\"/g' -} - -append_yaml_split_array() { - local file_path="$1" - local indent="$2" - local key="$3" - local value="$4" - local has_items=0 - - printf '%s%s:\n' "$indent" "$key" >> "$file_path" - - while IFS= read -r item; do - if [ -n "$item" ]; then - has_items=1 - printf '%s - "%s"\n' "$indent" "$(yaml_escape "$item")" >> "$file_path" - fi - done < <(printf '%s' "$value" | awk 'BEGIN{FS="[,,[:space:]]+"} {for (i=1; i<=NF; i++) if ($i != "") print $i}') - - if [ "$has_items" -eq 0 ]; then - printf '%s []\n' "$indent" >> "$file_path" - fi -} +# shellcheck source=yaml_utils.sh +source "$(dirname "$0")/yaml_utils.sh" # Parse a Markdown table into YAML timeline entries. # Expected table format (header row + separator row + data rows): diff --git a/.github/scripts/save-restaurant.sh b/.github/scripts/save-restaurant.sh index b2eb193..14bb463 100644 --- a/.github/scripts/save-restaurant.sh +++ b/.github/scripts/save-restaurant.sh @@ -1,29 +1,39 @@ #!/usr/bin/env bash set -euo pipefail -yaml_escape() { - printf '%s' "$1" | sed 's/\\/\\\\/g; s/"/\\"/g' -} - -append_yaml_split_array() { +# shellcheck source=yaml_utils.sh +source "$(dirname "$0")/yaml_utils.sh" + +# Parse a Markdown table into YAML food entries. +# Expected table format (header row + separator row + data rows): +# | 品名 / Dish | 价格 / Price | +# | --- | --- | +# | 招牌咖啡 | ¥35 | +append_yaml_food_table() { local file_path="$1" - local indent="$2" - local key="$3" - local value="$4" - local has_items=0 + local table="$2" + local indent="$3" + local has_rows=0 - printf '%s%s:\n' "$indent" "$key" >> "$file_path" + while IFS= read -r line; do + [[ "$line" =~ ^\| ]] || continue + [[ "$line" =~ ^\|[[:space:]]*-+[[:space:]]*\| ]] && continue - while IFS= read -r item; do - if [ -n "$item" ]; then - has_items=1 - printf '%s - "%s"\n' "$indent" "$(yaml_escape "$item")" >> "$file_path" - fi - done < <(printf '%s' "$value" | awk 'BEGIN{FS="[,,[:space:]]+"} {for (i=1; i<=NF; i++) if ($i != "") print $i}') + local name price + name=$(printf '%s' "$line" | awk -F'|' '{gsub(/^[[:space:]]+|[[:space:]]+$/, "", $2); print $2}') + price=$(printf '%s' "$line" | awk -F'|' '{gsub(/^[[:space:]]+|[[:space:]]+$/, "", $3); print $3}') - if [ "$has_items" -eq 0 ]; then - printf '%s []\n' "$indent" >> "$file_path" - fi + # Skip header row (name column contains non-digit non-Chinese characters typical of headers) + [ -z "$name" ] && continue + [[ "$name" =~ ^(品名|Dish|名称|Name) ]] && continue + + if [ "$has_rows" -eq 0 ]; then + printf '%sfood:\n' "$indent" >> "$file_path" + fi + has_rows=1 + printf '%s - name: "%s"\n' "$indent" "$(yaml_escape "$name")" >> "$file_path" + printf '%s price: "%s"\n' "$indent" "$(yaml_escape "$price")" >> "$file_path" + done <<< "$table" } RESTAURANTS_FILE="${RESTAURANTS_FILE_PATH:-data/restaurants.yml}" @@ -36,9 +46,15 @@ RESTAURANTS_FILE="${RESTAURANTS_FILE_PATH:-data/restaurants.yml}" append_yaml_split_array "$RESTAURANTS_FILE" " " "features" "${RESTAURANT_FEATURES:-}" +append_yaml_food_table "$RESTAURANTS_FILE" "${RESTAURANT_FOOD:-}" " " + +{ + printf ' avg_spend: "%s"\n' "$(yaml_escape "${RESTAURANT_AVG_SPEND:-}")" +} >> "$RESTAURANTS_FILE" + +append_yaml_split_array "$RESTAURANTS_FILE" " " "social_values" "${RESTAURANT_SOCIAL_VALUES:-}" + { - printf ' food: "%s"\n' "$(yaml_escape "${RESTAURANT_FOOD:-}")" - printf ' value: "%s"\n' "$(yaml_escape "${RESTAURANT_VALUE:-}")" printf ' address: "%s"\n' "$(yaml_escape "${RESTAURANT_ADDRESS:-}")" printf ' lat: "%s"\n' "$(yaml_escape "${RESTAURANT_LAT:-}")" printf ' lng: "%s"\n' "$(yaml_escape "${RESTAURANT_LNG:-}")" diff --git a/.github/scripts/yaml_utils.sh b/.github/scripts/yaml_utils.sh new file mode 100644 index 0000000..df94f1e --- /dev/null +++ b/.github/scripts/yaml_utils.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +# Shared YAML utility functions for data-save scripts. + +yaml_escape() { + printf '%s' "$1" | sed 's/\\/\\\\/g; s/"/\\"/g' +} + +# Append a YAML array from a comma-separated (or Chinese-comma-separated) string. +# Usage: append_yaml_split_array +append_yaml_split_array() { + local file_path="$1" + local indent="$2" + local key="$3" + local value="$4" + local has_items=0 + + printf '%s%s:\n' "$indent" "$key" >> "$file_path" + + while IFS= read -r item; do + if [ -n "$item" ]; then + has_items=1 + printf '%s - "%s"\n' "$indent" "$(yaml_escape "$item")" >> "$file_path" + fi + done < <(printf '%s' "$value" | awk 'BEGIN{FS="[,,]"} {for (i=1; i<=NF; i++) {gsub(/^[[:space:]]+|[[:space:]]+$/, "", $i); if ($i != "") print $i}}') + + if [ "$has_items" -eq 0 ]; then + printf '%s []\n' "$indent" >> "$file_path" + fi +} diff --git a/.github/workflows/submit-restaurant.yml b/.github/workflows/submit-restaurant.yml index 9d0285d..3cfa7bd 100644 --- a/.github/workflows/submit-restaurant.yml +++ b/.github/workflows/submit-restaurant.yml @@ -28,7 +28,8 @@ jobs: RESTAURANT_DESCRIPTION: ${{ steps.issue-parser.outputs.issueparser_description }} RESTAURANT_FEATURES: ${{ steps.issue-parser.outputs.issueparser_features }} RESTAURANT_FOOD: ${{ steps.issue-parser.outputs.issueparser_food }} - RESTAURANT_VALUE: ${{ steps.issue-parser.outputs.issueparser_value }} + RESTAURANT_AVG_SPEND: ${{ steps.issue-parser.outputs.issueparser_avg_spend }} + RESTAURANT_SOCIAL_VALUES: ${{ steps.issue-parser.outputs.issueparser_social_values }} RESTAURANT_ADDRESS: ${{ steps.issue-parser.outputs.issueparser_address }} RESTAURANT_LAT: ${{ steps.issue-parser.outputs.issueparser_lat }} RESTAURANT_LNG: ${{ steps.issue-parser.outputs.issueparser_lng }} diff --git a/README.md b/README.md index aee95a2..5a4f500 100644 --- a/README.md +++ b/README.md @@ -7,26 +7,29 @@ This repository is the standalone data repository for [GoodAction Hub](https://g ## 功能入口 / Features - [提交活动 / Submit Activity][1] -- [提交餐厅 / Submit Restaurant][4] -- [审核列表 / Review List][2] -- [JSON API][3] +- [提交餐厅 / Submit Restaurant][2] +- [审核列表 / Review List][3] +- [JSON API][4] -## 如何添加活动数据 / How to Add Activity Data +## 如何添加数据 / How to Add Data -💡 **新手友好**:推荐通过上方功能入口的"[提交活动][1]"链接来提交,填写表单即可,无需了解 Git 操作。 +💡 **新手友好**:推荐通过上方功能入口的"[提交活动][1]"或"[提交餐厅][2]"链接来提交,填写表单即可,无需了解 Git 操作。 -💡 **Beginner-friendly**: It is recommended to submit via the "[Submit Activity][1]" link above — just fill in a form, no Git knowledge needed. +💡 **Beginner-friendly**: Submit via the "[Submit Activity][1]" or "[Submit Restaurant][2]" links above — just fill in a form, no Git knowledge needed. -所有活动数据都存储在 `data/activities.yml` 中,`category` 字段区分类型(`meetup`、`conference`、`competition`)。 +- 活动数据存储在 `data/activities.yml`,`category` 字段区分类型(`meetup`、`conference`、`competition`)。 +- 餐厅数据存储在 `data/restaurants.yml`。 -All activity data is stored in `data/activities.yml`, with the `category` field distinguishing the type (`meetup`, `conference`, `competition`). +All activity data is stored in `data/activities.yml`; all restaurant data is stored in `data/restaurants.yml`. -如果您熟悉 Git 和 Pull Request 流程,也可以直接编辑 `data/activities.yml` 并提交 Pull Request。 +如果您熟悉 Git 和 Pull Request 流程,也可以直接编辑对应文件并提交 Pull Request。 -If you are familiar with Git and Pull Requests, you can also directly edit `data/activities.yml` and submit a Pull Request. +If you are familiar with Git and Pull Requests, you can also directly edit the corresponding file and submit a Pull Request. ## 数据结构 / Data Structure +### 活动 / Activities + 请在 `data/activities.yml` 中,仿照以下格式添加新条目: ```yaml @@ -62,23 +65,7 @@ If you are familiar with Git and Pull Requests, you can also directly edit `data - `timezone`: 请使用标准的 IANA 时区名称(例如 `Asia/Shanghai`),否则会影响时区转换 - `place`: 活动地址,如 `中国,上海`(`国家,城市`);如果是线上活动,直接写 `线上` -> 🎉 **每一份贡献都很珍贵,欢迎您的参与!** - -## 如何添加餐厅数据 / How to Add Restaurant Data - -💡 **新手友好**:推荐通过上方功能入口的"[提交餐厅][4]"链接来提交,填写表单即可。 - -💡 **Beginner-friendly**: It is recommended to submit via the "[Submit Restaurant][4]" link above — just fill in a form. - -所有餐厅数据都存储在 `data/restaurants.yml` 中。 - -All restaurant data is stored in `data/restaurants.yml`. - -如果您熟悉 Git 和 Pull Request 流程,也可以直接编辑 `data/restaurants.yml` 并提交 Pull Request。 - -If you are familiar with Git and Pull Requests, you can also directly edit `data/restaurants.yml` and submit a Pull Request. - -## 餐厅数据结构 / Restaurant Data Structure +### 餐厅 / Restaurants 请在 `data/restaurants.yml` 中,仿照以下格式添加新条目: @@ -90,8 +77,15 @@ If you are familiar with Git and Pull Requests, you can also directly edit `data - 手语服务 - 无障碍通道 - 盲文菜单 - food: 咖啡、甜品 - value: 提供残障友好服务与就业机会 + food: + - name: 招牌咖啡 + price: ¥35 + - name: 无障碍套餐 + price: ¥68 + avg_spend: ¥50 + social_values: + - 残障就业支持 + - 无障碍通道 address: 上海市静安区示例路1号 lat: "31.2304" # GPS 纬度 lng: "121.4737" # GPS 经度 @@ -105,6 +99,6 @@ If you are familiar with Git and Pull Requests, you can also directly edit `data - [BiYuanShe/Fake-Open-Source-wiki](https://github.com/BiYuanShe/Fake-Open-Source-wiki) [1]: https://github.com/GoodAction-Hub/GoodAction-data/issues/new?template=activity.yml -[2]: https://github.com/GoodAction-Hub/GoodAction-data/pulls -[3]: https://goodaction-hub.github.io/GoodAction-data/ -[4]: https://github.com/GoodAction-Hub/GoodAction-data/issues/new?template=restaurant.yml +[2]: https://github.com/GoodAction-Hub/GoodAction-data/issues/new?template=restaurant.yml +[3]: https://github.com/GoodAction-Hub/GoodAction-data/pulls +[4]: https://goodaction-hub.github.io/GoodAction-data/ diff --git a/data/competitions.yml b/data/competitions.yml deleted file mode 100644 index e69de29..0000000 diff --git a/data/conferences.yml b/data/conferences.yml deleted file mode 100644 index e69de29..0000000 From 4a32c9345b2c499ff3dd7b0236a7b7f2e01c579b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Mar 2026 19:25:06 +0000 Subject: [PATCH 8/9] Extract generic append_yaml_table into yaml_utils.sh, used by both save scripts Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com> --- .github/scripts/save-event.sh | 36 +++------------------------ .github/scripts/save-restaurant.sh | 36 +++------------------------ .github/scripts/yaml_utils.sh | 40 ++++++++++++++++++++++++++++++ data/activities.yml | 13 ++++++++++ data/restaurants.yml | 12 +++++++++ 5 files changed, 71 insertions(+), 66 deletions(-) diff --git a/.github/scripts/save-event.sh b/.github/scripts/save-event.sh index 024b6d8..564a52f 100644 --- a/.github/scripts/save-event.sh +++ b/.github/scripts/save-event.sh @@ -4,38 +4,6 @@ set -euo pipefail # shellcheck source=yaml_utils.sh source "$(dirname "$0")/yaml_utils.sh" -# Parse a Markdown table into YAML timeline entries. -# Expected table format (header row + separator row + data rows): -# | 关键日期 / Deadline | 说明 / Description | -# | --- | --- | -# | 2025-10-19T23:59:00 | 论文征集截止 | -append_yaml_timeline() { - local file_path="$1" - local table="$2" - local has_rows=0 - - while IFS= read -r line; do - # Only process lines that look like table rows - [[ "$line" =~ ^\| ]] || continue - # Skip separator rows (e.g. | --- | --- |) - [[ "$line" =~ ^\|[[:space:]]*-+[[:space:]]*\| ]] && continue - - local deadline comment - deadline=$(printf '%s' "$line" | awk -F'|' '{gsub(/^[[:space:]]+|[[:space:]]+$/, "", $2); print $2}') - comment=$(printf '%s' "$line" | awk -F'|' '{gsub(/^[[:space:]]+|[[:space:]]+$/, "", $3); print $3}') - - # Skip header rows (deadline column starts with a digit for valid ISO date entries) - [[ "$deadline" =~ ^[0-9] ]] || continue - - if [ "$has_rows" -eq 0 ]; then - printf ' timeline:\n' >> "$file_path" - fi - has_rows=1 - printf ' - deadline: "%s"\n' "$(yaml_escape "$deadline")" >> "$file_path" - printf ' comment: "%s"\n' "$(yaml_escape "$comment")" >> "$file_path" - done <<< "$table" -} - ACTIVITIES_FILE="${ACTIVITIES_FILE_PATH:-data/activities.yml}" { @@ -54,7 +22,9 @@ append_yaml_split_array "$ACTIVITIES_FILE" " " "tags" "${ACTIVITY_TAGS:-}" printf ' end_time: "%s"\n' "$(yaml_escape "${ACTIVITY_END_TIME:-}")" } >> "$ACTIVITIES_FILE" -append_yaml_timeline "$ACTIVITIES_FILE" "${ACTIVITY_TIMELINE:-}" +# Parse timeline Markdown table: skip header rows (col1 doesn't start with a digit) +append_yaml_table "$ACTIVITIES_FILE" " " "timeline" "deadline" "comment" \ + "${ACTIVITY_TIMELINE:-}" "^[^0-9]" { printf ' timezone: "%s"\n' "$(yaml_escape "${ACTIVITY_TIMEZONE:-}")" diff --git a/.github/scripts/save-restaurant.sh b/.github/scripts/save-restaurant.sh index 14bb463..6d0d508 100644 --- a/.github/scripts/save-restaurant.sh +++ b/.github/scripts/save-restaurant.sh @@ -4,38 +4,6 @@ set -euo pipefail # shellcheck source=yaml_utils.sh source "$(dirname "$0")/yaml_utils.sh" -# Parse a Markdown table into YAML food entries. -# Expected table format (header row + separator row + data rows): -# | 品名 / Dish | 价格 / Price | -# | --- | --- | -# | 招牌咖啡 | ¥35 | -append_yaml_food_table() { - local file_path="$1" - local table="$2" - local indent="$3" - local has_rows=0 - - while IFS= read -r line; do - [[ "$line" =~ ^\| ]] || continue - [[ "$line" =~ ^\|[[:space:]]*-+[[:space:]]*\| ]] && continue - - local name price - name=$(printf '%s' "$line" | awk -F'|' '{gsub(/^[[:space:]]+|[[:space:]]+$/, "", $2); print $2}') - price=$(printf '%s' "$line" | awk -F'|' '{gsub(/^[[:space:]]+|[[:space:]]+$/, "", $3); print $3}') - - # Skip header row (name column contains non-digit non-Chinese characters typical of headers) - [ -z "$name" ] && continue - [[ "$name" =~ ^(品名|Dish|名称|Name) ]] && continue - - if [ "$has_rows" -eq 0 ]; then - printf '%sfood:\n' "$indent" >> "$file_path" - fi - has_rows=1 - printf '%s - name: "%s"\n' "$indent" "$(yaml_escape "$name")" >> "$file_path" - printf '%s price: "%s"\n' "$indent" "$(yaml_escape "$price")" >> "$file_path" - done <<< "$table" -} - RESTAURANTS_FILE="${RESTAURANTS_FILE_PATH:-data/restaurants.yml}" { @@ -46,7 +14,9 @@ RESTAURANTS_FILE="${RESTAURANTS_FILE_PATH:-data/restaurants.yml}" append_yaml_split_array "$RESTAURANTS_FILE" " " "features" "${RESTAURANT_FEATURES:-}" -append_yaml_food_table "$RESTAURANTS_FILE" "${RESTAURANT_FOOD:-}" " " +# Parse food Markdown table: skip header rows by matching known header words in col1 +append_yaml_table "$RESTAURANTS_FILE" " " "food" "name" "price" \ + "${RESTAURANT_FOOD:-}" "^(品名|Dish|名称|Name)" { printf ' avg_spend: "%s"\n' "$(yaml_escape "${RESTAURANT_AVG_SPEND:-}")" diff --git a/.github/scripts/yaml_utils.sh b/.github/scripts/yaml_utils.sh index df94f1e..650bed4 100644 --- a/.github/scripts/yaml_utils.sh +++ b/.github/scripts/yaml_utils.sh @@ -27,3 +27,43 @@ append_yaml_split_array() { printf '%s []\n' "$indent" >> "$file_path" fi } + +# Parse a 2-column Markdown table and append YAML list entries. +# Usage: append_yaml_table [header_pattern] +# header_pattern: ERE regex; rows where col1 matches are treated as headers and skipped. +# Expected table format (header row + separator row + data rows): +# | 列1 / Col1 | 列2 / Col2 | +# | --- | --- | +# | value1 | value2 | +append_yaml_table() { + local file_path="$1" + local indent="$2" + local list_key="$3" + local col1_key="$4" + local col2_key="$5" + local table="$6" + local header_pattern="${7:-}" + local has_rows=0 + + while IFS= read -r line; do + # Only process lines that look like table rows + [[ "$line" =~ ^\| ]] || continue + # Skip separator rows (e.g. | --- | --- |) + [[ "$line" =~ ^\|[[:space:]]*-+[[:space:]]*\| ]] && continue + + local col1 col2 + col1=$(printf '%s' "$line" | awk -F'|' '{gsub(/^[[:space:]]+|[[:space:]]+$/, "", $2); print $2}') + col2=$(printf '%s' "$line" | awk -F'|' '{gsub(/^[[:space:]]+|[[:space:]]+$/, "", $3); print $3}') + + # Skip empty or header rows + [ -z "$col1" ] && continue + [ -n "$header_pattern" ] && [[ "$col1" =~ $header_pattern ]] && continue + + if [ "$has_rows" -eq 0 ]; then + printf '%s%s:\n' "$indent" "$list_key" >> "$file_path" + has_rows=1 + fi + printf '%s - %s: "%s"\n' "$indent" "$col1_key" "$(yaml_escape "$col1")" >> "$file_path" + printf '%s %s: "%s"\n' "$indent" "$col2_key" "$(yaml_escape "$col2")" >> "$file_path" + done <<< "$table" +} diff --git a/data/activities.yml b/data/activities.yml index e69de29..7183611 100644 --- a/data/activities.yml +++ b/data/activities.yml @@ -0,0 +1,13 @@ +- title: "" + category: "" + description: "" + tags: + [] + events: + - id: "" + link: "" + start_time: "" + end_time: "" + timezone: "" + place: "" + issue_link: "" diff --git a/data/restaurants.yml b/data/restaurants.yml index e69de29..5750475 100644 --- a/data/restaurants.yml +++ b/data/restaurants.yml @@ -0,0 +1,12 @@ +- id: "" + name: "" + description: "" + features: + [] + avg_spend: "" + social_values: + [] + address: "" + lat: "" + lng: "" + issue_link: "" From 3e863b342bbdff898cd17de21cf112db7a7d7056 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Mar 2026 19:29:15 +0000 Subject: [PATCH 9/9] Clear activities.yml and restaurants.yml - leave empty for future data migration Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com> --- data/activities.yml | 13 ------------- data/restaurants.yml | 12 ------------ 2 files changed, 25 deletions(-) diff --git a/data/activities.yml b/data/activities.yml index 7183611..e69de29 100644 --- a/data/activities.yml +++ b/data/activities.yml @@ -1,13 +0,0 @@ -- title: "" - category: "" - description: "" - tags: - [] - events: - - id: "" - link: "" - start_time: "" - end_time: "" - timezone: "" - place: "" - issue_link: "" diff --git a/data/restaurants.yml b/data/restaurants.yml index 5750475..e69de29 100644 --- a/data/restaurants.yml +++ b/data/restaurants.yml @@ -1,12 +0,0 @@ -- id: "" - name: "" - description: "" - features: - [] - avg_spend: "" - social_values: - [] - address: "" - lat: "" - lng: "" - issue_link: ""