Skip to content

Commit 91479af

Browse files
authored
Merge branch 'main' into all-contributors/add-ananyag309
2 parents 343838c + 2fbcf1b commit 91479af

26 files changed

+294
-7
lines changed

.all-contributorsrc

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,10 +399,156 @@
399399
]
400400
},
401401
{
402+
402403
"login": "ananyag309",
403404
"name": "Ananya Gupta",
404405
"avatar_url": "https://avatars.githubusercontent.com/u/145869907?v=4",
405406
"profile": "https://www.linkedin.com/in/ananya-gupta-30aa9b28b/",
407+
"login": "Maheshwari-Love",
408+
"name": "Maheshwari Love",
409+
"avatar_url": "https://avatars.githubusercontent.com/u/142833275?v=4",
410+
"profile": "https://github.com/Maheshwari-Love",
411+
"login": "vysuvysavya",
412+
"name": "Vysavya",
413+
"avatar_url": "https://avatars.githubusercontent.com/u/163625527?v=4",
414+
"profile": "https://github.com/vysuvysavya",
415+
"login": "abhibhande",
416+
"name": "Abhishek Bhande",
417+
"avatar_url": "https://avatars.githubusercontent.com/u/68599334?v=4",
418+
"profile": "https://github.com/abhibhande",
419+
"login": "HimanshuNarware",
420+
"name": "Himanshu Narware",
421+
"avatar_url": "https://avatars.githubusercontent.com/u/83147410?v=4",
422+
"profile": "https://github.com/HimanshuNarware",
423+
"login": "Zeenatattar",
424+
"name": "Zeenat",
425+
"avatar_url": "https://avatars.githubusercontent.com/u/111846814?v=4",
426+
"profile": "https://github.com/Zeenatattar",
427+
"login": "rohitroy-github",
428+
"name": "Rohit Roy",
429+
"avatar_url": "https://avatars.githubusercontent.com/u/68563695?v=4",
430+
"profile": "https://linktr.ee/rohitroy_r",
431+
"login": "Varsani2520",
432+
"name": "v_a_r_s_a_n_i",
433+
"avatar_url": "https://avatars.githubusercontent.com/u/137641079?v=4",
434+
"profile": "https://github.com/Varsani2520",
435+
436+
"login": "4darsh-Dev",
437+
"name": "ADARSH MAURYA",
438+
"avatar_url": "https://avatars.githubusercontent.com/u/109789509?v=4",
439+
"profile": "https://linktr.ee/4darsh_dev",
440+
"login": "Sanchitbajaj02",
441+
"name": "Sanchit Bajaj",
442+
"avatar_url": "https://avatars.githubusercontent.com/u/55249639?v=4",
443+
"profile": "https://sanchitbajaj02.github.io/portfolio",
444+
"login": "ChhaviRohilla",
445+
"name": "Chhavi Rohilla",
446+
"avatar_url": "https://avatars.githubusercontent.com/u/136676662?v=4",
447+
"profile": "https://github.com/ChhaviRohilla",
448+
},
449+
{
450+
"login": "abhisheks008",
451+
"name": "Abhishek Sharma",
452+
"avatar_url": "https://avatars.githubusercontent.com/u/68724349?v=4",
453+
"profile": "https://abhisheks008.bio.link/",
454+
},
455+
{
456+
"login": "sourabhkumar47",
457+
"name": "Sourabh Kumar",
458+
"avatar_url": "https://avatars.githubusercontent.com/u/81826285?v=4",
459+
"profile": "http://sourabhkumar.tech/",
460+
},
461+
{
462+
"login": "Soumya-Kushwaha",
463+
"name": "Soumya Kushwaha",
464+
"avatar_url": "https://avatars.githubusercontent.com/u/87495134?v=4",
465+
"profile": "https://github.com/Soumya-Kushwaha",
466+
"contributions": [
467+
"review"
468+
]
469+
},
470+
{
471+
"login": "Jagpreet153",
472+
"name": "Jagpreet Singh Khurana",
473+
"avatar_url": "https://avatars.githubusercontent.com/u/119691733?v=4",
474+
"profile": "https://github.com/Jagpreet153",
475+
},
476+
{
477+
"login": "hirapurekannu72",
478+
"name": "hirapurekannu72",
479+
"avatar_url": "https://avatars.githubusercontent.com/u/146826102?v=4",
480+
"profile": "https://github.com/hirapurekannu72",
481+
"contributions": [
482+
"review"
483+
]
484+
},
485+
{
486+
"login": "Krish-Depani",
487+
"name": "Krish Depani",
488+
"avatar_url": "https://avatars.githubusercontent.com/u/72994417?v=4",
489+
"profile": "https://github.com/Krish-Depani",
490+
"contributions": [
491+
"review"
492+
]
493+
},
494+
{
495+
"login": "Devamani11D",
496+
"name": "Duddekunta Devamani",
497+
"avatar_url": "https://avatars.githubusercontent.com/u/117567542?v=4",
498+
"profile": "https://github.com/Devamani11D",
499+
},
500+
{
501+
"login": "Rohith2201",
502+
"name": "J VENKATA LAKSHMI SAI ROHITH",
503+
"avatar_url": "https://avatars.githubusercontent.com/u/94969985?v=4",
504+
"profile": "https://julururohith.blogspot.com/",
505+
},
506+
{
507+
"login": "GauravKesh",
508+
"name": "Gaurav Kesh Roushan",
509+
"avatar_url": "https://avatars.githubusercontent.com/u/98611148?v=4",
510+
"profile": "https://gkrcoder.vercel.app",
511+
"contributions": [
512+
"review"
513+
]
514+
},
515+
{
516+
"login": "shaurya35",
517+
"name": "Shaurya Jha",
518+
"avatar_url": "https://avatars.githubusercontent.com/u/106850641?v=4",
519+
"profile": "https://shauryacreativefolio.netlify.app/",
520+
"contributions": [
521+
"review"
522+
]
523+
},
524+
{
525+
"login": "Luson045",
526+
"name": "Luson Basumatary",
527+
"avatar_url": "https://avatars.githubusercontent.com/u/131430087?v=4",
528+
"profile": "https://github.com/Luson045",
529+
},
530+
{
531+
"login": "iitzIrFan",
532+
"name": "iitzIrFan",
533+
"avatar_url": "https://avatars.githubusercontent.com/u/138690953?v=4",
534+
"profile": "https://irfan-shaikh-portfolio.vercel.app/",
535+
"login": "vijaychandra1910",
536+
"name": "VIJAY KUMAR CHANDRA",
537+
"avatar_url": "https://avatars.githubusercontent.com/u/138502362?v=4",
538+
"profile": "https://linktr.ee/vijay__19",
539+
"contributions": [
540+
"review"
541+
]
542+
},
543+
{
544+
"login": "theashikagupta",
545+
"name": "Ashika Gupta",
546+
"avatar_url": "https://avatars.githubusercontent.com/u/136061047?v=4",
547+
"profile": "https://github.com/theashikagupta",
548+
549+
550+
551+
406552
"contributions": [
407553
"review"
408554
]

.github/workflows/allcontributor_autocommentor_active_issue.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: Comment on Active "Add Profile" Issues
1+
name: Comment on Active Add Profile Issues
22

33
on:
44
workflow_dispatch:
55
schedule:
6-
- cron: '0 */3 * * *'
6+
- cron: '0 */6 * * *'
77

88
jobs:
99
comment-on-active-issues:
@@ -27,13 +27,27 @@ jobs:
2727
const issueCreator = issue.user.login;
2828
const commentMessage = `@all-contributors please add @${issueCreator} for review`;
2929
30-
await github.rest.issues.createComment({
30+
const { data: comments } = await github.rest.issues.listComments({
3131
owner: context.repo.owner,
3232
repo: context.repo.repo,
33-
issue_number: issue.number,
34-
body: commentMessage
33+
issue_number: issue.number
3534
});
3635
37-
console.log(`Commented on issue #${issue.number}`);
36+
const hasAllContributorsComment = comments.some(comment =>
37+
comment.body.includes('@all-contributors please add')
38+
);
39+
40+
if (!hasAllContributorsComment) {
41+
await github.rest.issues.createComment({
42+
owner: context.repo.owner,
43+
repo: context.repo.repo,
44+
issue_number: issue.number,
45+
body: commentMessage
46+
});
47+
48+
console.log(`Commented on issue #${issue.number}`);
49+
} else {
50+
console.log(`Skipped commenting on issue #${issue.number} - already has an all-contributors comment`);
51+
}
3852
}
3953
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Merge Active All-Contributors PRs
2+
3+
on:
4+
schedule:
5+
- cron: '0 */6 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
merge-active-prs:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
18+
19+
- name: Merge active PRs
20+
uses: actions/github-script@v6
21+
with:
22+
github-token: ${{ secrets.GITHUB_TOKEN }}
23+
script: |
24+
const { data: pullRequests } = await github.rest.pulls.list({
25+
owner: context.repo.owner,
26+
repo: context.repo.repo,
27+
state: 'open',
28+
sort: 'created',
29+
direction: 'asc'
30+
});
31+
32+
for (const pr of pullRequests) {
33+
if (pr.user.login === 'allcontributors[bot]' && pr.mergeable_state === 'clean') {
34+
try {
35+
await github.rest.pulls.merge({
36+
owner: context.repo.owner,
37+
repo: context.repo.repo,
38+
pull_number: pr.number,
39+
merge_method: 'squash'
40+
});
41+
console.log(`Successfully merged PR #${pr.number}`);
42+
} catch (error) {
43+
console.error(`Failed to merge PR #${pr.number}: ${error.message}`);
44+
}
45+
}
46+
}

.github/workflows/codereview.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Auto-Approve and Merge Pull Requests
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
schedule:
7+
- cron: '0 */6 * * *'
8+
workflow_dispatch:
9+
10+
jobs:
11+
auto-approve-and-merge:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
pull-requests: write
15+
contents: write
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v3
20+
21+
- name: Install PyGithub
22+
run: pip install PyGithub
23+
24+
- name: Auto-approve and Merge Pull Requests
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
run: |
28+
import os
29+
from github import Github
30+
def approve_and_merge_pr(pr):
31+
pr.create_review(event='APPROVE', body='Automatically approved')
32+
print(f"Approved PR #{pr.number}")
33+
if pr.mergeable:
34+
pr.merge(merge_method='squash')
35+
print(f"Merged PR #{pr.number}")
36+
else:
37+
print(f"PR #{pr.number} is not mergeable")
38+
g = Github(os.getenv('GITHUB_TOKEN'))
39+
repo = g.get_repo(os.getenv('GITHUB_REPOSITORY'))
40+
if os.getenv('GITHUB_EVENT_NAME') == 'pull_request':
41+
pr_number = os.getenv('GITHUB_EVENT_PULL_REQUEST_NUMBER')
42+
pr = repo.get_pull(int(pr_number))
43+
approve_and_merge_pr(pr)
44+
else:
45+
for pr in repo.get_pulls(state='open'):
46+
approve_and_merge_pr(pr)
47+
print("Auto-approval and merge process completed successfully.")
48+
shell: python

0 commit comments

Comments
 (0)