-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #161 from nishant0708/mergeintogh
Updating .
- Loading branch information
Showing
106 changed files
with
1,701 additions
and
835 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Close Issues on PR Merge | ||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
close-issues: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Close linked issues | ||
if: github.event.pull_request.merged == true | ||
run: | | ||
# Extract issue numbers from both direct references and comment links | ||
ISSUES=$(jq -r '.pull_request.body' "$GITHUB_EVENT_PATH" | grep -Eo '(#|issues/)[0-9]+' | grep -Eo '[0-9]+') | ||
for ISSUE in $ISSUES | ||
do | ||
echo "Closing issue #$ISSUE" | ||
# Post a comment on the issue | ||
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE/comments \ | ||
-d '{"body":"Closed by PR #${{ github.event.pull_request.number }}"}' | ||
# Close the issue | ||
curl -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE \ | ||
-d '{"state":"closed"}' | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Update Categories on PR | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
update-categories: | ||
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.x' | ||
|
||
- name: Install Dependencies | ||
run: npm install | ||
|
||
- name: Update Contributors File | ||
run: node .github/workflows/update-contributors.js ${{ github.event.pull_request.user.login }} "${{ github.event.pull_request.body }}" | ||
|
||
- name: Commit and Push Changes | ||
run: | | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
git add .all-contributorsrc | ||
git commit -m "Update categories for ${{ github.event.pull_request.user.login }}" | ||
git push | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
const username = process.argv[2]; | ||
const prBody = process.argv[3]; | ||
const screenshotUrl = `https://raw.githubusercontent.com/nishant0708/awesome-github-profiles/main/screenshots/${username}.png`; | ||
|
||
// Extract selected categories from the PR body | ||
const categories = (prBody.match(/\[(x| )\] (.+)/g) || []).map(line => line.replace(/^\[(x| )\] /, '')); | ||
|
||
const contributorsFilePath = path.join(process.cwd(), '.all-contributorsrc'); | ||
const contributorsData = JSON.parse(fs.readFileSync(contributorsFilePath, 'utf8')); | ||
|
||
// Check if the user already exists in the contributors data | ||
const existingContributor = contributorsData.contributors.find(contributor => contributor.login === username); | ||
|
||
if (existingContributor) { | ||
// Update existing contributor's categories | ||
existingContributor.contributions = categories; | ||
} else { | ||
// Add a new contributor | ||
contributorsData.contributors.push({ | ||
login: username, | ||
name: username, // Customize as needed | ||
avatar_url: `https://avatars.githubusercontent.com/${username}`, | ||
ScreenShot: screenshotUrl, | ||
profile: `https://github.com/${username}`, | ||
contributions: categories | ||
}); | ||
} | ||
|
||
fs.writeFileSync(contributorsFilePath, JSON.stringify(contributorsData, null, 2)); | ||
console.log('Contributors file updated successfully!'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
document.addEventListener('scroll', () => { | ||
const button = document.getElementById('scrollToTop'); | ||
if (window.scrollY > 300) { // Adjust this value based on when you want the button to appear | ||
button.classList.add('show'); | ||
} else { | ||
button.classList.remove('show'); | ||
} | ||
}); | ||
|
||
document.getElementById('scrollToTop').addEventListener('click', () => { | ||
window.scrollTo({ | ||
top: 0, | ||
behavior: 'smooth' | ||
}); | ||
}); | ||
|
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Oops, something went wrong.