Skip to content

Commit

Permalink
Merge branch 'main' into all-contributors/add-RSN601KRI
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjay-kv authored Oct 2, 2024
2 parents dbbf3d2 + be375e0 commit c571613
Show file tree
Hide file tree
Showing 28 changed files with 318 additions and 7 deletions.
161 changes: 161 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,171 @@
]
},
{

"login": "RSN601KRI",
"name": "Roshni Kumari",
"avatar_url": "https://avatars.githubusercontent.com/u/106860359?v=4",
"profile": "https://portfolio-sigma-jade-52.vercel.app/",


"login": "PayalKumari10",
"name": "PAYAL KUMARI",
"avatar_url": "https://avatars.githubusercontent.com/u/123013327?v=4",
"profile": "https://www.linkedin.com/in/payalkumari10",
"login": "sanayamahajan-23",
"name": "sanaya mahajan",
"avatar_url": "https://avatars.githubusercontent.com/u/112759683?v=4",
"profile": "https://github.com/sanayamahajan-23",
"login": "samarsajad",
"name": "Samar Sajad",
"avatar_url": "https://avatars.githubusercontent.com/u/142666229?v=4",
"profile": "https://github.com/samarsajad",
"login": "ananyag309",
"name": "Ananya Gupta",
"avatar_url": "https://avatars.githubusercontent.com/u/145869907?v=4",
"profile": "https://www.linkedin.com/in/ananya-gupta-30aa9b28b/",
"login": "Maheshwari-Love",
"name": "Maheshwari Love",
"avatar_url": "https://avatars.githubusercontent.com/u/142833275?v=4",
"profile": "https://github.com/Maheshwari-Love",
"login": "vysuvysavya",
"name": "Vysavya",
"avatar_url": "https://avatars.githubusercontent.com/u/163625527?v=4",
"profile": "https://github.com/vysuvysavya",
"login": "abhibhande",
"name": "Abhishek Bhande",
"avatar_url": "https://avatars.githubusercontent.com/u/68599334?v=4",
"profile": "https://github.com/abhibhande",
"login": "HimanshuNarware",
"name": "Himanshu Narware",
"avatar_url": "https://avatars.githubusercontent.com/u/83147410?v=4",
"profile": "https://github.com/HimanshuNarware",
"login": "Zeenatattar",
"name": "Zeenat",
"avatar_url": "https://avatars.githubusercontent.com/u/111846814?v=4",
"profile": "https://github.com/Zeenatattar",
"login": "rohitroy-github",
"name": "Rohit Roy",
"avatar_url": "https://avatars.githubusercontent.com/u/68563695?v=4",
"profile": "https://linktr.ee/rohitroy_r",
"login": "Varsani2520",
"name": "v_a_r_s_a_n_i",
"avatar_url": "https://avatars.githubusercontent.com/u/137641079?v=4",
"profile": "https://github.com/Varsani2520",

"login": "4darsh-Dev",
"name": "ADARSH MAURYA",
"avatar_url": "https://avatars.githubusercontent.com/u/109789509?v=4",
"profile": "https://linktr.ee/4darsh_dev",
"login": "Sanchitbajaj02",
"name": "Sanchit Bajaj",
"avatar_url": "https://avatars.githubusercontent.com/u/55249639?v=4",
"profile": "https://sanchitbajaj02.github.io/portfolio",
"login": "ChhaviRohilla",
"name": "Chhavi Rohilla",
"avatar_url": "https://avatars.githubusercontent.com/u/136676662?v=4",
"profile": "https://github.com/ChhaviRohilla",
},
{
"login": "abhisheks008",
"name": "Abhishek Sharma",
"avatar_url": "https://avatars.githubusercontent.com/u/68724349?v=4",
"profile": "https://abhisheks008.bio.link/",
},
{
"login": "sourabhkumar47",
"name": "Sourabh Kumar",
"avatar_url": "https://avatars.githubusercontent.com/u/81826285?v=4",
"profile": "http://sourabhkumar.tech/",
},
{
"login": "Soumya-Kushwaha",
"name": "Soumya Kushwaha",
"avatar_url": "https://avatars.githubusercontent.com/u/87495134?v=4",
"profile": "https://github.com/Soumya-Kushwaha",
"contributions": [
"review"
]
},
{
"login": "Jagpreet153",
"name": "Jagpreet Singh Khurana",
"avatar_url": "https://avatars.githubusercontent.com/u/119691733?v=4",
"profile": "https://github.com/Jagpreet153",
},
{
"login": "hirapurekannu72",
"name": "hirapurekannu72",
"avatar_url": "https://avatars.githubusercontent.com/u/146826102?v=4",
"profile": "https://github.com/hirapurekannu72",
"contributions": [
"review"
]
},
{
"login": "Krish-Depani",
"name": "Krish Depani",
"avatar_url": "https://avatars.githubusercontent.com/u/72994417?v=4",
"profile": "https://github.com/Krish-Depani",
"contributions": [
"review"
]
},
{
"login": "Devamani11D",
"name": "Duddekunta Devamani",
"avatar_url": "https://avatars.githubusercontent.com/u/117567542?v=4",
"profile": "https://github.com/Devamani11D",
},
{
"login": "Rohith2201",
"name": "J VENKATA LAKSHMI SAI ROHITH",
"avatar_url": "https://avatars.githubusercontent.com/u/94969985?v=4",
"profile": "https://julururohith.blogspot.com/",
},
{
"login": "GauravKesh",
"name": "Gaurav Kesh Roushan",
"avatar_url": "https://avatars.githubusercontent.com/u/98611148?v=4",
"profile": "https://gkrcoder.vercel.app",
"contributions": [
"review"
]
},
{
"login": "shaurya35",
"name": "Shaurya Jha",
"avatar_url": "https://avatars.githubusercontent.com/u/106850641?v=4",
"profile": "https://shauryacreativefolio.netlify.app/",
"contributions": [
"review"
]
},
{
"login": "Luson045",
"name": "Luson Basumatary",
"avatar_url": "https://avatars.githubusercontent.com/u/131430087?v=4",
"profile": "https://github.com/Luson045",
},
{
"login": "iitzIrFan",
"name": "iitzIrFan",
"avatar_url": "https://avatars.githubusercontent.com/u/138690953?v=4",
"profile": "https://irfan-shaikh-portfolio.vercel.app/",
"login": "vijaychandra1910",
"name": "VIJAY KUMAR CHANDRA",
"avatar_url": "https://avatars.githubusercontent.com/u/138502362?v=4",
"profile": "https://linktr.ee/vijay__19",
"contributions": [
"review"
]
},
{
"login": "theashikagupta",
"name": "Ashika Gupta",
"avatar_url": "https://avatars.githubusercontent.com/u/136061047?v=4",
"profile": "https://github.com/theashikagupta",

"contributions": [
"review"
]
Expand Down
26 changes: 20 additions & 6 deletions .github/workflows/allcontributor_autocommentor_active_issue.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Comment on Active "Add Profile" Issues
name: Comment on Active Add Profile Issues

on:
workflow_dispatch:
schedule:
- cron: '0 */3 * * *'
- cron: '0 */6 * * *'

jobs:
comment-on-active-issues:
Expand All @@ -27,13 +27,27 @@ jobs:
const issueCreator = issue.user.login;
const commentMessage = `@all-contributors please add @${issueCreator} for review`;
await github.rest.issues.createComment({
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
body: commentMessage
issue_number: issue.number
});
console.log(`Commented on issue #${issue.number}`);
const hasAllContributorsComment = comments.some(comment =>
comment.body.includes('@all-contributors please add')
);
if (!hasAllContributorsComment) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
body: commentMessage
});
console.log(`Commented on issue #${issue.number}`);
} else {
console.log(`Skipped commenting on issue #${issue.number} - already has an all-contributors comment`);
}
}
}
46 changes: 46 additions & 0 deletions .github/workflows/allcontributor_autopr_merge_active.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Merge Active All-Contributors PRs

on:
schedule:
- cron: '0 */6 * * *'
workflow_dispatch:

jobs:
merge-active-prs:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Merge active PRs
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { data: pullRequests } = await github.rest.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
sort: 'created',
direction: 'asc'
});
for (const pr of pullRequests) {
if (pr.user.login === 'allcontributors[bot]' && pr.mergeable_state === 'clean') {
try {
await github.rest.pulls.merge({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pr.number,
merge_method: 'squash'
});
console.log(`Successfully merged PR #${pr.number}`);
} catch (error) {
console.error(`Failed to merge PR #${pr.number}: ${error.message}`);
}
}
}
48 changes: 48 additions & 0 deletions .github/workflows/codereview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Auto-Approve and Merge Pull Requests

on:
pull_request:
types: [opened, synchronize, reopened]
schedule:
- cron: '0 */6 * * *'
workflow_dispatch:

jobs:
auto-approve-and-merge:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install PyGithub
run: pip install PyGithub

- name: Auto-approve and Merge Pull Requests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
import os
from github import Github
def approve_and_merge_pr(pr):
pr.create_review(event='APPROVE', body='Automatically approved')
print(f"Approved PR #{pr.number}")
if pr.mergeable:
pr.merge(merge_method='squash')
print(f"Merged PR #{pr.number}")
else:
print(f"PR #{pr.number} is not mergeable")
g = Github(os.getenv('GITHUB_TOKEN'))
repo = g.get_repo(os.getenv('GITHUB_REPOSITORY'))
if os.getenv('GITHUB_EVENT_NAME') == 'pull_request':
pr_number = os.getenv('GITHUB_EVENT_PULL_REQUEST_NUMBER')
pr = repo.get_pull(int(pr_number))
approve_and_merge_pr(pr)
else:
for pr in repo.get_pulls(state='open'):
approve_and_merge_pr(pr)
print("Auto-approval and merge process completed successfully.")
shell: python
Loading

0 comments on commit c571613

Please sign in to comment.