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
62 - A stable (non-alpha/beta) release is required at a minimum 62 - A stable (non-alpha/beta) release is required at a minimum
63 - Must be accessible to the general public, and not just a select group of people 63 - Must be accessible to the general public, and not just a select group of people
64 - If technical knowledge is required to run it, the software must be well documented 64 - 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
65 69
66_There may be some exceptions, but these would need to be fully justified, reviewed 70_There may be some exceptions, but these would need to be fully justified, reviewed
67by the community, and the drawbacks / anti-features must be clearly listed along-side the software. 71by 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
79- You must respond to any comments or requests for changes in a timely manner, 14 days maximum 83- You must respond to any comments or requests for changes in a timely manner, 14 days maximum
80- 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` 84- 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`
81- Only include a single addition / amendment / removal, per pull request 85- 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!
83- 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 87- 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
84- 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 88- 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
85- Your entry should be added at the bottom of the appropriate category, unless otherwise requested 89- 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
88- 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 90- 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)
90- 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 92- 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
91- Your changes must be correctly spelled, and with good grammar 93- Your changes must be correctly spelled, and with good grammar
92- Your changes must be correctly formatted, in valid yaml and markdown 94- Your changes must be correctly formatted, in valid yaml and markdown
93- The addition title must be a link the project
94- The addition description must be no less than 50, and no more than 250 characters, keep it clear and to the point 95- 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
95 98
96--- 99---
97 100
.github/workflows/pr-check.yml +9 −1
@@ -82,7 +82,9 @@ jobs:
82 uses: actions/upload-artifact@v4 82 uses: actions/upload-artifact@v4
83 with: 83 with:
84 name: pr-diff 84 name: pr-diff
85 path: /tmp/pr-diff.json 85 path: |
86 /tmp/pr-diff.json
87 /tmp/pr-diff-summary.md
86 if-no-files-found: ignore 88 if-no-files-found: ignore
87 - name: Upload findings 89 - name: Upload findings
88 if: always() 90 if: always()
@@ -142,6 +144,12 @@ jobs:
142 path: /tmp/artifacts 144 path: /tmp/artifacts
143 merge-multiple: true 145 merge-multiple: true
144 continue-on-error: true 146 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
145 - name: Format comment 153 - name: Format comment
146 env: 154 env:
147 PR_USER: ${{ github.event.pull_request.user.login }} 155 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):
131 """Return a finding if an added service has openSource missing or not true.""" 131 """Return a finding if an added service has openSource missing or not true."""
132 for svc in diff.get("services", {}).get("added", []): 132 for svc in diff.get("services", {}).get("added", []):
133 fields = svc.get("fields", {}) 133 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"):
135 return OPENSOURCE_MSG 135 return OPENSOURCE_MSG
136 return None 136 return None
137 137
@@ -221,7 +221,7 @@ def check_description_length(diff):
221 for svc in diff.get("services", {}).get("added", []): 221 for svc in diff.get("services", {}).get("added", []):
222 desc = svc.get("fields", {}).get("description", "") 222 desc = svc.get("fields", {}).get("description", "")
223 length = len(desc) 223 length = len(desc)
224 if length < 50 or length > 250: 224 if length < 50 or length > 280:
225 return DESC_LENGTH_MSG.format(length=length) 225 return DESC_LENGTH_MSG.format(length=length)
226 return None 226 return None
227 227
lib/checks/check-project.py +103
@@ -17,6 +17,12 @@ TIMEOUT = 10
17USER_AGENT = "awesome-privacy-ci/1.0" 17USER_AGENT = "awesome-privacy-ci/1.0"
18MIN_STARS = 100 18MIN_STARS = 100
19INACTIVE_DAYS = 90 19INACTIVE_DAYS = 90
20MIN_AGE_DAYS = 120
21AI_COMMIT_THRESHOLD = 5
22AI_BOT_AUTHORS = [
23 "noreply@anthropic.com",
24 "devin-ai-integration[bot]",
25]
20 26
21LINK_MSG = ( 27LINK_MSG = (
22 "Our automated checks were unable to verify the link(s) you included" 28 "Our automated checks were unable to verify the link(s) you included"
@@ -35,6 +41,29 @@ ACTIVITY_MSG = (
35 "Please confirm that the project you are adding is actively maintained," 41 "Please confirm that the project you are adding is actively maintained,"
36 " as it looks to not have had any recent updates in the past 3 months." 42 " as it looks to not have had any recent updates in the past 3 months."
37) 43)
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)
38 67
39 68
40def load_diff(path): 69def load_diff(path):
@@ -154,6 +183,51 @@ def check_links(diff, head):
154 return None 183 return None
155 184
156 185
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
157def check_repo_signals(diff, pr_user, token): 231def check_repo_signals(diff, pr_user, token):
158 """Check GitHub repo author match, stars, and activity for added services.""" 232 """Check GitHub repo author match, stars, and activity for added services."""
159 findings = [] 233 findings = []
@@ -185,6 +259,15 @@ def check_repo_signals(diff, pr_user, token):
185 if stars < MIN_STARS and STARS_MSG not in findings: 259 if stars < MIN_STARS and STARS_MSG not in findings:
186 findings.append(STARS_MSG) 260 findings.append(STARS_MSG)
187 261
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
188 pushed = data.get("pushed_at") 271 pushed = data.get("pushed_at")
189 if pushed and ACTIVITY_MSG not in findings: 272 if pushed and ACTIVITY_MSG not in findings:
190 try: 273 try:
@@ -195,6 +278,26 @@ def check_repo_signals(diff, pr_user, token):
195 except Exception: 278 except Exception:
196 pass 279 pass
197 280
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
198 return findings 301 return findings
199 302
200 303
lib/checks/check-yaml-diff.py +23 −7
@@ -13,6 +13,7 @@ import yaml
13PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) 13PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
14DATA_PATH = os.path.join(PROJECT_ROOT, "awesome-privacy.yml") 14DATA_PATH = os.path.join(PROJECT_ROOT, "awesome-privacy.yml")
15DIFF_OUTPUT_PATH = "/tmp/pr-diff.json" 15DIFF_OUTPUT_PATH = "/tmp/pr-diff.json"
16SUMMARY_OUTPUT_PATH = "/tmp/pr-diff-summary.md"
16 17
17EXIT_PASS = 0 18EXIT_PASS = 0
18EXIT_RULE_VIOLATION = 1 19EXIT_RULE_VIOLATION = 1
@@ -112,13 +113,8 @@ def fmt_path(key):
112 return " → ".join(key) if isinstance(key, tuple) else key 113 return " → ".join(key) if isinstance(key, tuple) else key
113 114
114 115
115def write_step_summary(diff_result): 116def format_diff_bullets(diff_result):
116 """Write a bullet-point Markdown summary to $GITHUB_STEP_SUMMARY.""" 117 """Build bullet-point lines summarizing all changes. Returns list of strings or empty list."""
117 summary_file = os.environ.get("GITHUB_STEP_SUMMARY")
118 if not summary_file:
119 return
120
121 lines = ["## YAML Diff Analysis\n"]
122 bullets = [] 118 bullets = []
123 119
124 for svc in diff_result["services"]["added"]: 120 for svc in diff_result["services"]["added"]:
@@ -149,6 +145,25 @@ def write_step_summary(diff_result):
149 f"in {dup['category']} → {dup['section']}" 145 f"in {dup['category']} → {dup['section']}"
150 ) 146 )
151 147
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"]
152 if bullets: 167 if bullets:
153 lines.extend(bullets) 168 lines.extend(bullets)
154 else: 169 else:
@@ -213,6 +228,7 @@ def main():
213 228
214 write_github_output("has_service_changes", str(bool(added or removed or modified)).lower()) 229 write_github_output("has_service_changes", str(bool(added or removed or modified)).lower())
215 write_step_summary(diff_result) 230 write_step_summary(diff_result)
231 write_diff_summary(diff_result)
216 232
217 added_count = len(added) 233 added_count = len(added)
218 if added_count > 1: 234 if added_count > 1:
lib/checks/format-comment.py +50 −23
@@ -7,19 +7,9 @@ import sys
7ARTIFACTS_DIR = "/tmp/artifacts" 7ARTIFACTS_DIR = "/tmp/artifacts"
8OUTPUT_DIR = "/tmp/pr-meta" 8OUTPUT_DIR = "/tmp/pr-meta"
9 9
10CONTRIBUTING = "https://github.com/Lissy93/awesome-privacy/blob/main/.github/CONTRIBUTING.md" 10REPO_URL = "https://github.com/Lissy93/awesome-privacy"
11 11CONTRIBUTING = f"{REPO_URL}/blob/main/.github/CONTRIBUTING.md"
12COMMENT_TEMPLATE = """<!-- pr-check-bot --> 12DIFF_SUMMARY_PATH = os.path.join(ARTIFACTS_DIR, "pr-diff-summary.md")
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!"""
23 13
24 14
25def load_findings(filename): 15def load_findings(filename):
@@ -41,12 +31,49 @@ def collect_findings():
41 return all_findings 31 return all_findings
42 32
43 33
44def format_comment(findings, user): 34def load_diff_summary():
45 """Build the markdown comment from findings.""" 35 """Load the pre-formatted diff summary, or None if unavailable."""
46 bullet_list = "\n".join(f"- {f}" for f in findings) 36 try:
47 return COMMENT_TEMPLATE.format( 37 with open(DIFF_SUMMARY_PATH) as f:
48 user=user, contributing=CONTRIBUTING, findings=bullet_list, 38 content = f.read().strip()
49 ) 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"
50 77
51 78
52def write_step_summary(findings): 79def write_step_summary(findings):
@@ -81,12 +108,12 @@ def main():
81 f.write(run_id) 108 f.write(run_id)
82 109
83 findings = collect_findings() 110 findings = collect_findings()
111 changes_summary = load_diff_summary()
84 write_step_summary(findings) 112 write_step_summary(findings)
85 113
86 if findings: 114 comment = format_comment(findings, user, changes_summary, run_id)
87 comment = format_comment(findings, user) 115 with open(os.path.join(OUTPUT_DIR, "comment.md"), "w") as f:
88 with open(os.path.join(OUTPUT_DIR, "comment.md"), "w") as f: 116 f.write(comment)
89 f.write(comment)
90 except Exception: 117 except Exception:
91 pass 118 pass
92 119