Skip to content

Commit

Permalink
Merge branch 'main' into all-contributors/add-thevijayshankersharma
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjay-kv authored Aug 4, 2024
2 parents fe67be9 + d12685a commit 57bf165
Show file tree
Hide file tree
Showing 11 changed files with 230 additions and 78 deletions.
21 changes: 19 additions & 2 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,31 @@
"commitType": "docs",
"commitConvention": "angular",
"contributors": [
{
"login": "MastanSayyad",
"name": "Mastan Sayyad",
"avatar_url": "https://avatars.githubusercontent.com/u/101971980?v=4",
"profile": "https://github.com/MastanSayyad",
"contributions": [
"review"
]
},
{
"login": "sanjay-kv",
"name": "Sanjay Viswanathan",
"avatar_url": "https://avatars.githubusercontent.com/u/30715153?v=4",
"profile": "https://recodehive.com",
"contributions": [
"review"
]
},
{
"login": "dinxsh",
"name": "Dinesh Talwadker",
"avatar_url": "https://avatars.githubusercontent.com/u/90450035?v=4",
"profile": "https://dinxsh.xyz",
"contributions": [
"bug",
"maintenance"
"review"
]
},
{
Expand Down
43 changes: 0 additions & 43 deletions .github/scripts/addContributor.js

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/add-contributor-on-issue.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/autocomment-iss-close.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Comment on Issue Close

on:
issues:
types: [closed]

jobs:
greet-on-close:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Greet User
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const issue = context.payload.issue;
const issueCreator = issue.user.login;
const issueNumber = issue.number;
const greetingMessage = `Hello @${issueCreator}! Your issue #${issueNumber} has been closed. Thank you for your contribution!`;
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
body: greetingMessage
});
34 changes: 34 additions & 0 deletions .github/workflows/capture-screenshot.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const puppeteer = require('puppeteer');
const fs = require('fs');
const path = require('path');

async function takeScreenshot(username) {
const url = `https://github.com/${username}`;
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto(url);

await page.setViewport({ width: 1280, height: 800 });
const screenshotPath = path.join('screenshots', `${username}.png`);
await page.screenshot({ path: screenshotPath, fullPage: true });

await browser.close();
return screenshotPath;
}

async function main() {
const username = process.argv[2];
if (!username) {
console.error('No username provided');
process.exit(1);
}

if (!fs.existsSync('screenshots')) {
fs.mkdirSync('screenshots');
}

const screenshotPath = await takeScreenshot(username);
console.log(`Screenshot taken for ${username}: ${screenshotPath}`);
}

main();
37 changes: 37 additions & 0 deletions .github/workflows/close-old-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Close Old Issues
on:
schedule:
- cron: "0 0 * * *"

jobs:
close-issues:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Close Old Issues
run: |
open_issues=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/issues?state=open" \
| jq -r '.[] | .number')
for issue in $open_issues; do
# Get the last updated timestamp of the issue
last_updated=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/issues/$issue" \
| jq -r '.updated_at')
days_since_update=$(( ( $(date +%s) - $(date -d "$last_updated" +%s) ) / 86400 ))
if [ $days_since_update -gt 30 ]; then
curl -s -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
-d '{"state":"closed"}' \
"https://api.github.com/repos/${{ github.repository }}/issues/$issue"
# Add a comment explaining when the issue will be closed
curl -s -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
-d '{"body":"This issue has been automatically closed because it has been inactive for more than 30 days. If you believe this is still relevant, feel free to reopen it or create a new one. Thank you!"}' \
"https://api.github.com/repos/${{ github.repository }}/issues/$issue/comments"
fi
done
34 changes: 34 additions & 0 deletions .github/workflows/close-old-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Close Stale PRs

on:
schedule:
- cron: '0 0 * * *' # Runs daily at midnight
pull_request:
types:
- opened
- reopened
- synchronize

permissions:
pull-requests: write
issues: write

jobs:
close_stale_prs:
runs-on: ubuntu-latest
permissions:
pull-requests: write

steps:
- uses: actions/stale@v7
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-pr-message: 'This PR has been automatically closed due to inactivity from the owner for 15 days.'
days-before-pr-stale: 15
days-before-pr-close: 0
exempt-pr-author: false
exempt-pr-labels: ''
only-labels: ''
operations-per-run: 30
remove-stale-when-updated: true
debug-only: false
32 changes: 32 additions & 0 deletions .github/workflows/screenshot-on-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Capture GitHub Profile Screenshot

on:
issues:
types: [opened]

jobs:
capture-screenshot:
runs-on: ubuntu-latest

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

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install Puppeteer
run: npm install puppeteer

- name: Capture Screenshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: node capture-screenshot.js ${{ github.event.issue.user.login }}

- name: Upload Screenshot
uses: actions/upload-artifact@v3
with:
name: screenshot
path: screenshots/
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
<div align="center">

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)

A list of awesome GitHub Profiles under one roof

### add your profile [here](https://github.com/recodehive/awesome-github-profiles/issues/new?assignees=&labels=%E2%9E%95+profile&projects=&template=add_profile.md&title=Add+Profile%3A+)
Expand All @@ -19,8 +23,14 @@ A list of awesome GitHub Profiles under one roof
<table>
<tbody>
<tr>

<td align="center" valign="top" width="14.28%"><a href="https://dinxsh.xyz"><img src="https://avatars.githubusercontent.com/u/90450035?v=4?s=100" width="100px;" alt="Dinesh Talwadker"/><br /><sub><b>Dinesh Talwadker</b></sub></a><br /><a href="https://github.com/recodehive/awesome-github-profiles/issues?q=author%3Adinxsh" title="Bug reports">🐛</a> <a href="#maintenance-dinxsh" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/thevijayshankersharma"><img src="https://avatars.githubusercontent.com/u/109781385?v=4?s=100" width="100px;" alt="Vijay Shanker Sharma"/><br /><sub><b>Vijay Shanker Sharma</b></sub></a><br /><a href="https://github.com/recodehive/awesome-github-profiles/pulls?q=is%3Apr+reviewed-by%3Athevijayshankersharma" title="Reviewed Pull Requests">👀</a></td>

<td align="center" valign="top" width="14.28%"><a href="https://github.com/MastanSayyad"><img src="https://avatars.githubusercontent.com/u/101971980?v=4?s=100" width="100px;" alt="Mastan Sayyad"/><br /><sub><b>Mastan Sayyad</b></sub></a><br /><a href="https://github.com/recodehive/awesome-github-profiles/pulls?q=is%3Apr+reviewed-by%3AMastanSayyad" title="Reviewed Pull Requests">👀</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://recodehive.com"><img src="https://avatars.githubusercontent.com/u/30715153?v=4?s=100" width="100px;" alt="Sanjay Viswanathan"/><br /><sub><b>Sanjay Viswanathan</b></sub></a><br /><a href="https://github.com/recodehive/awesome-github-profiles/pulls?q=is%3Apr+reviewed-by%3Asanjay-kv" title="Reviewed Pull Requests">👀</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://dinxsh.xyz"><img src="https://avatars.githubusercontent.com/u/90450035?v=4?s=100" width="100px;" alt="Dinesh Talwadker"/><br /><sub><b>Dinesh Talwadker</b></sub></a><br /><a href="https://github.com/recodehive/awesome-github-profiles/pulls?q=is%3Apr+reviewed-by%3Adinxsh" title="Reviewed Pull Requests">👀</a></td>

</tr>
</tbody>
</table>
Expand Down
34 changes: 34 additions & 0 deletions capture-screenshot.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const puppeteer = require('puppeteer');
const fs = require('fs');
const path = require('path');

async function takeScreenshot(username) {
const url = `https://github.com/${username}`;
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto(url);

await page.setViewport({ width: 1280, height: 800 });
const screenshotPath = path.join('screenshots', `${username}.png`);
await page.screenshot({ path: screenshotPath, fullPage: true });

await browser.close();
return screenshotPath;
}

async function main() {
const username = process.argv[2];
if (!username) {
console.error('No username provided');
process.exit(1);
}

if (!fs.existsSync('screenshots')) {
fs.mkdirSync('screenshots');
}

const screenshotPath = await takeScreenshot(username);
console.log(`Screenshot taken for ${username}: ${screenshotPath}`);
}

main();
1 change: 1 addition & 0 deletions screenshots/test1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

0 comments on commit 57bf165

Please sign in to comment.