Commit ce3a59e139

ce3a59e13911a18ec706ec2d80f2274a021a9241

parent: 843a49181f

Unsigned

Alicia Sykes <alicia@omg.lol> · 2026-02-26 12:24 UTC

Updates contributing and automated checks to ensure project age

Layout: unified · split

.github/CONTRIBUTING.md +8 −5
@@ -62,6 +62,10 @@ For software to be included in this list, it must meet the following requirement
6262 - A stable (non-alpha/beta) release is required at a minimum
6363 - Must be accessible to the general public, and not just a select group of people
6464 - If technical knowledge is required to run it, the software must be well documented
65- **Mature**
66 - Software needs to have a proven track record of commitment to maintenance
67 - Repositories must not be newly created, and the first stable release older than 4 months
68 - Projects primarily written with AI or vibe coded are not suitable for listing here
6569
6670_There may be some exceptions, but these would need to be fully justified, reviewed
6771by the community, and the drawbacks / anti-features must be clearly listed along-side the software.
@@ -79,19 +83,18 @@ Your pull request must follow these requirements. Failure to do so, might result
7983- You must respond to any comments or requests for changes in a timely manner, 14 days maximum
8084- Write short but descriptive git commit messages, under 50 characters. This must be in the format of `Adds [software-name] to [section-name]`. Your PR will be rejected if you name it `Updates README.md`
8185- Only include a single addition / amendment / removal, per pull request
82- You must complete each of the sections in the pull request template. Do not delete it!
86- You must complete each of the sections in the [pull request template](https://github.com/Lissy93/awesome-privacy/blob/main/.github/PULL_REQUEST_TEMPLATE.md). Do not delete it!
8387- Where applicable, include links to supporting material for your addition: git repo, docs, recent security audits, etc. This will make researching it much easier for reviewers
8488- While adding new software to the list, don't make your entry read like an advert. Be objective, and include drawbacks as well as strengths
8589- Your entry should be added at the bottom of the appropriate category, unless otherwise requested
86- If there are other pull requests open, please help review them before submitting yours
87- A pull request must receive multiple approval reviews before it can be merged
8890- You must be transparent about your affiliation with a product or service that you are adding. It's totally okay to submit your own projects as additions (providing they meet the requirements), but if you don't declare your association with that project then there becomes a clear conflict of interest
89- You must adhere to the Contributor Covenant Code of Conduct
91- You must adhere to the [Contributor Covenant Code of Conduct](https://github.com/Lissy93/awesome-privacy?tab=coc-ov-file#contributor-covenant-code-of-conduct)
9092- Don't open a Draft / WIP pull request while you work on the guidelines. A pull request should be 100% ready and should adhere to all the above guidelines when you open it
9193- Your changes must be correctly spelled, and with good grammar
9294- Your changes must be correctly formatted, in valid yaml and markdown
93- The addition title must be a link the project
9495- The addition description must be no less than 50, and no more than 250 characters, keep it clear and to the point
96- If there are other pull requests open, please help review them before submitting yours
97- A pull request must receive multiple approval reviews before it can be merged
9598
9699---
97100
.github/workflows/pr-check.yml +9 −1
@@ -82,7 +82,9 @@ jobs:
8282 uses: actions/upload-artifact@v4
8383 with:
8484 name: pr-diff
85 path: /tmp/pr-diff.json
85 path: |
86 /tmp/pr-diff.json
87 /tmp/pr-diff-summary.md
8688 if-no-files-found: ignore
8789 - name: Upload findings
8890 if: always()
@@ -142,6 +144,12 @@ jobs:
142144 path: /tmp/artifacts
143145 merge-multiple: true
144146 continue-on-error: true
147 - name: Download diff data
148 uses: actions/download-artifact@v4
149 with:
150 name: pr-diff
151 path: /tmp/artifacts
152 continue-on-error: true
145153 - name: Format comment
146154 env:
147155 PR_USER: ${{ github.event.pull_request.user.login }}
lib/.gitignore added +1
@@ -0,0 +1 @@
1__pycache__
\ No newline at end of file
lib/checks/check-additions.py +2 −2
@@ -131,7 +131,7 @@ def check_open_source(diff):
131131 """Return a finding if an added service has openSource missing or not true."""
132132 for svc in diff.get("services", {}).get("added", []):
133133 fields = svc.get("fields", {})
134 if fields.get("openSource") is not True:
134 if fields.get("openSource") is not True and not fields.get("github"):
135135 return OPENSOURCE_MSG
136136 return None
137137
@@ -221,7 +221,7 @@ def check_description_length(diff):
221221 for svc in diff.get("services", {}).get("added", []):
222222 desc = svc.get("fields", {}).get("description", "")
223223 length = len(desc)
224 if length < 50 or length > 250:
224 if length < 50 or length > 280:
225225 return DESC_LENGTH_MSG.format(length=length)
226226 return None
227227
lib/checks/check-project.py +103
@@ -17,6 +17,12 @@ TIMEOUT = 10
1717USER_AGENT = "awesome-privacy-ci/1.0"
1818MIN_STARS = 100
1919INACTIVE_DAYS = 90
20MIN_AGE_DAYS = 120
21AI_COMMIT_THRESHOLD = 5
22AI_BOT_AUTHORS = [
23 "noreply@anthropic.com",
24 "devin-ai-integration[bot]",
25]
2026
2127LINK_MSG = (
2228 "Our automated checks were unable to verify the link(s) you included"
@@ -35,6 +41,29 @@ ACTIVITY_MSG = (
3541 "Please confirm that the project you are adding is actively maintained,"
3642 " as it looks to not have had any recent updates in the past 3 months."
3743)
44MATURITY_MSG = (
45 "This project appears to be quite new (created less than 4 months ago)."
46 " Repositories should have a proven track record before listing."
47)
48AI_CODE_MSG = (
49 "This project appears to contain AI-generated code."
50 " Additional care will be needed when reviewing the submission."
51)
52FORK_MSG = (
53 "The GitHub link in this listing is a fork."
54 " Please confirm it's the correct (and actively maintained) repository"
55)
56LICENSE_MSG = (
57 "There doesn't appear to be a license included in the project's GitHub repo"
58)
59ARCHIVED_MSG = (
60 "The GitHub project linked has been archived."
61 " Additions must be actively maintained."
62)
63SECURITY_MSG = (
64 "This project has open security vulnerabilities (critical or high severity)"
65 " flagged by GitHub Dependabot. Please verify these have been addressed"
66)
3867
3968
4069def load_diff(path):
@@ -154,6 +183,51 @@ def check_links(diff, head):
154183 return None
155184
156185
186def check_ai_commits(owner, repo, token):
187 """Return AI_CODE_MSG if recent commits contain significant AI bot activity."""
188 try:
189 headers = {"Accept": "application/vnd.github.v3+json", "User-Agent": USER_AGENT}
190 if token:
191 headers["Authorization"] = f"token {token}"
192 resp = requests.get(
193 f"https://api.github.com/repos/{owner}/{repo}/commits",
194 headers=headers, timeout=TIMEOUT, params={"per_page": 100},
195 )
196 if resp.status_code != 200:
197 return None
198 bot_set = {a.lower() for a in AI_BOT_AUTHORS}
199 count = 0
200 for commit in resp.json():
201 author = commit.get("commit", {}).get("author", {})
202 email = (author.get("email") or "").lower()
203 name = (author.get("name") or "").lower()
204 if email in bot_set or name in bot_set:
205 count += 1
206 if count >= AI_COMMIT_THRESHOLD:
207 return AI_CODE_MSG
208 except Exception:
209 pass
210 return None
211
212
213def check_security_alerts(owner, repo, token):
214 """Return SECURITY_MSG if the repo has open critical/high Dependabot alerts."""
215 try:
216 headers = {"Accept": "application/vnd.github.v3+json", "User-Agent": USER_AGENT}
217 if token:
218 headers["Authorization"] = f"token {token}"
219 resp = requests.get(
220 f"https://api.github.com/repos/{owner}/{repo}/dependabot/alerts",
221 headers=headers, timeout=TIMEOUT,
222 params={"state": "open", "severity": "critical,high", "per_page": 1},
223 )
224 if resp.status_code == 200 and resp.json():
225 return SECURITY_MSG
226 except Exception:
227 pass
228 return None
229
230
157231def check_repo_signals(diff, pr_user, token):
158232 """Check GitHub repo author match, stars, and activity for added services."""
159233 findings = []
@@ -185,6 +259,15 @@ def check_repo_signals(diff, pr_user, token):
185259 if stars < MIN_STARS and STARS_MSG not in findings:
186260 findings.append(STARS_MSG)
187261
262 if data.get("fork") and FORK_MSG not in findings:
263 findings.append(FORK_MSG)
264
265 if not data.get("license") and LICENSE_MSG not in findings:
266 findings.append(LICENSE_MSG)
267
268 if data.get("archived") and ARCHIVED_MSG not in findings:
269 findings.append(ARCHIVED_MSG)
270
188271 pushed = data.get("pushed_at")
189272 if pushed and ACTIVITY_MSG not in findings:
190273 try:
@@ -195,6 +278,26 @@ def check_repo_signals(diff, pr_user, token):
195278 except Exception:
196279 pass
197280
281 created = data.get("created_at")
282 if created and MATURITY_MSG not in findings:
283 try:
284 created_dt = datetime.fromisoformat(created.replace("Z", "+00:00"))
285 now = datetime.now(timezone.utc)
286 if (now - created_dt).days < MIN_AGE_DAYS:
287 findings.append(MATURITY_MSG)
288 except Exception:
289 pass
290
291 if AI_CODE_MSG not in findings:
292 finding = check_ai_commits(owner, repo, token)
293 if finding:
294 findings.append(finding)
295
296 if SECURITY_MSG not in findings:
297 finding = check_security_alerts(owner, repo, token)
298 if finding:
299 findings.append(finding)
300
198301 return findings
199302
200303
lib/checks/check-yaml-diff.py +23 −7
@@ -13,6 +13,7 @@ import yaml
1313PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
1414DATA_PATH = os.path.join(PROJECT_ROOT, "awesome-privacy.yml")
1515DIFF_OUTPUT_PATH = "/tmp/pr-diff.json"
16SUMMARY_OUTPUT_PATH = "/tmp/pr-diff-summary.md"
1617
1718EXIT_PASS = 0
1819EXIT_RULE_VIOLATION = 1
@@ -112,13 +113,8 @@ def fmt_path(key):
112113 return " → ".join(key) if isinstance(key, tuple) else key
113114
114115
115def write_step_summary(diff_result):
116 """Write a bullet-point Markdown summary to $GITHUB_STEP_SUMMARY."""
117 summary_file = os.environ.get("GITHUB_STEP_SUMMARY")
118 if not summary_file:
119 return
120
121 lines = ["## YAML Diff Analysis\n"]
116def format_diff_bullets(diff_result):
117 """Build bullet-point lines summarizing all changes. Returns list of strings or empty list."""
122118 bullets = []
123119
124120 for svc in diff_result["services"]["added"]:
@@ -149,6 +145,25 @@ def write_step_summary(diff_result):
149145 f"in {dup['category']} → {dup['section']}"
150146 )
151147
148 return bullets
149
150
151def write_diff_summary(diff_result):
152 """Write the bullet-point summary to a file for downstream consumers."""
153 bullets = format_diff_bullets(diff_result)
154 if bullets:
155 with open(SUMMARY_OUTPUT_PATH, "w") as f:
156 f.write("\n".join(bullets) + "\n")
157
158
159def write_step_summary(diff_result):
160 """Write a bullet-point Markdown summary to $GITHUB_STEP_SUMMARY."""
161 summary_file = os.environ.get("GITHUB_STEP_SUMMARY")
162 if not summary_file:
163 return
164
165 bullets = format_diff_bullets(diff_result)
166 lines = ["## YAML Diff Analysis\n"]
152167 if bullets:
153168 lines.extend(bullets)
154169 else:
@@ -213,6 +228,7 @@ def main():
213228
214229 write_github_output("has_service_changes", str(bool(added or removed or modified)).lower())
215230 write_step_summary(diff_result)
231 write_diff_summary(diff_result)
216232
217233 added_count = len(added)
218234 if added_count > 1:
lib/checks/format-comment.py +50 −23
@@ -7,19 +7,9 @@ import sys
77ARTIFACTS_DIR = "/tmp/artifacts"
88OUTPUT_DIR = "/tmp/pr-meta"
99
10CONTRIBUTING = "https://github.com/Lissy93/awesome-privacy/blob/main/.github/CONTRIBUTING.md"
11
12COMMENT_TEMPLATE = """<!-- pr-check-bot -->
13Hello @{user}
14
15Thank you for contributing to Awesome Privacy! We will review your PR shortly. In the meantime, please ensure that your submission is inline with our guidelines in our [Contributing Requirements]({contributing}).
16
17Looks like there could be some issues in your PR. Please double check that:
18
19{findings}
20
21> [!NOTE]
22> I am a bot, and sometimes make mistakes in my suggestions. But a human will review your submission shortly!"""
10REPO_URL = "https://github.com/Lissy93/awesome-privacy"
11CONTRIBUTING = f"{REPO_URL}/blob/main/.github/CONTRIBUTING.md"
12DIFF_SUMMARY_PATH = os.path.join(ARTIFACTS_DIR, "pr-diff-summary.md")
2313
2414
2515def load_findings(filename):
@@ -41,12 +31,49 @@ def collect_findings():
4131 return all_findings
4232
4333
44def format_comment(findings, user):
45 """Build the markdown comment from findings."""
46 bullet_list = "\n".join(f"- {f}" for f in findings)
47 return COMMENT_TEMPLATE.format(
48 user=user, contributing=CONTRIBUTING, findings=bullet_list,
49 )
34def load_diff_summary():
35 """Load the pre-formatted diff summary, or None if unavailable."""
36 try:
37 with open(DIFF_SUMMARY_PATH) as f:
38 content = f.read().strip()
39 return content if content else None
40 except Exception:
41 return None
42
43
44def format_comment(findings, user, changes_summary, run_id):
45 """Build the markdown comment."""
46 parts = [
47 f"<!-- pr-check-bot -->\nHello @{user}\n",
48 f"Thank you for contributing to Awesome Privacy! We will review your "
49 f"submission shortly. In the meantime, please ensure all changes are "
50 f"correct and inline with our [Contributing Requirements]({CONTRIBUTING}).\n",
51 ]
52
53 if findings:
54 bullet_list = "\n".join(f"- {f}" for f in findings)
55 parts.append(
56 f"Our automated checks detected some issues:\n\n{bullet_list}\n\n"
57 f"> [!NOTE]\n"
58 f"> I am a bot, and sometimes make mistakes in my suggestions. "
59 f"But a human will review your submission shortly!"
60 )
61 else:
62 parts.append("> ✅ All our automated checks have passed.")
63
64 if changes_summary:
65 parts.append(
66 f"<details><summary>Summary of Changes:</summary>\n\n"
67 f"{changes_summary}\n</details>"
68 )
69
70 if run_id:
71 parts.append(
72 f'<sup>For full details, please see workflow run '
73 f'<a href="{REPO_URL}/actions/runs/{run_id}">{run_id}</a></sup>'
74 )
75
76 return "\n\n".join(parts) + "\n"
5077
5178
5279def write_step_summary(findings):
@@ -81,12 +108,12 @@ def main():
81108 f.write(run_id)
82109
83110 findings = collect_findings()
111 changes_summary = load_diff_summary()
84112 write_step_summary(findings)
85113
86 if findings:
87 comment = format_comment(findings, user)
88 with open(os.path.join(OUTPUT_DIR, "comment.md"), "w") as f:
89 f.write(comment)
114 comment = format_comment(findings, user, changes_summary, run_id)
115 with open(os.path.join(OUTPUT_DIR, "comment.md"), "w") as f:
116 f.write(comment)
90117 except Exception:
91118 pass
92119