Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Anjaliavv51 authored Jan 13, 2025
2 parents 8a0b9ef + 4029ac3 commit 0f7b74f
Show file tree
Hide file tree
Showing 35 changed files with 3,352 additions and 1,125 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ body:
options:
- label: "I have read the Contributing Guidelines"
required: true
- label: "I'm a GSSOC'24EXTD contributor"
- label: "I'm a SWOC contributor"
required: true
- label: "I have starred the repository"
required: true
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/documentation_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ body:
options:
- label: "I have read the Contributing Guidelines"
required: true
- label: "I'm a GSSOC'24EXTD contributor"
- label: "I'm a SWOC contributor"
required: true
- label: "I have starred the repository"
required: true
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ body:
options:
- label: "I have read the Contributing Guidelines"
required: true
- label: "I'm a GSSOC'24EXTD contributor"
- label: "I'm a SWOC contributor"
required: true
- label: "I have starred the repository"
required: true
3 changes: 2 additions & 1 deletion .github/workflows/auto-label-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
labels: ['gssoc-ext','hacktoberfest-accepted']
//labels: ['gssoc-ext','hacktoberfest-accepted']
labels: ['SWOC']
});
const addLabel = async (label) => {
await github.rest.issues.addLabels({
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/close all issues
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Close All Open Issues

on:
workflow_dispatch:

jobs:
close_issues:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Close open issues
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { owner, repo } = context.repo;
const issues = await github.rest.issues.listForRepo({
owner,
repo,
state: 'open' // Only fetch open issues
});
for (const issue of issues.data) {
await github.rest.issues.update({
owner,
repo,
issue_number: issue.number,
state: 'closed'
});
console.log(`Issue #${issue.number} closed.`);
}
86 changes: 40 additions & 46 deletions .github/workflows/close-old-issue.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,49 @@
name: Close Old Issues
name: Close All Issues

on:
schedule:
- cron: "0 0 * * *" # Runs daily at midnight
workflow_dispatch: # Allows the workflow to be triggered manually

permissions:
issues: write # Explicitly grant write permission to issues

jobs:
manage-issues:
close_issues:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Debug Context
uses: actions/github-script@v6
with:
script: |
console.log(`Repository: ${context.repo.owner}/${context.repo.repo}`);
console.log(`Workflow triggered by: ${context.actor}`);
- name: Manage 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 issue details
issue_details=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/issues/$issue")
last_updated=$(echo $issue_details | jq -r '.updated_at')
labels=$(echo $issue_details | jq -r '.labels[].name')
- name: Fetch and close all open issues
uses: actions/github-script@v6
with:
script: |
const issues = await github.paginate(github.rest.issues.listForRepo, {
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open' // Fetch only open issues
});
days_since_update=$(( ( $(date +%s) - $(date -d "$last_updated" +%s) ) / 86400 ))
if (issues.length === 0) {
console.log("No open issues to close.");
} else {
console.log(`Found ${issues.length} open issues.`);
}
if [ $days_since_update -gt 7 ]; then
if echo "$labels" | grep -q "stale"; then
# If stale for more than 10 days, close the issue
if [ $days_since_update -gt 17 ]; 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"
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 17 days (including 7 days marked as stale). 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
else
# Mark as stale
curl -s -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
-d '{"labels":["stale"]}' \
"https://api.github.com/repos/${{ github.repository }}/issues/$issue/labels"
curl -s -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
-d '{"body":"This issue has been marked as stale because it has been inactive for more than 7 days. It will be closed if no further activity occurs in the next 10 days. Please update if you want to keep it open."}' \
"https://api.github.com/repos/${{ github.repository }}/issues/$issue/comments"
fi
fi
done
for (const issue of issues) {
if (!issue.pull_request) { // Ensure it’s an issue, not a pull request
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
state: 'closed'
});
console.log(`Closed issue #${issue.number}: ${issue.title}`);
} else {
console.log(`Skipped pull request #${issue.number}`);
}
}
6 changes: 4 additions & 2 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
- uses: EddieHubCommunity/gh-action-community/src/welcome@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "Hi there! Thanks for opening this issue @${{ github.actor }}!. We appreciate your contribution to this open-source project. We aim to respond or assign your issue as soon as possible."
pr-message: "Great job, @${{ github.actor }}! 🎉 Thank you for submitting your pull request. Your contribution is valuable and we appreciate your efforts to improve our project.We will promptly review your changes and offer feedback. Keep up the excellent work! Kindly remember to check our [contributing guidelines](https://github.com/Anshika14528/RAPIDOC-HEALTHCARE-WEBSITE-/blob/main/CONTRIBUTING.md)"
issue-message: "Hi there! Thanks for opening this issue @${{ github.actor }}!. We appreciate your contribution to this open-source project. We aim to respond or assign your issue as soon as possible.If belong's to SWOC program role ur self as Contributor in OS lead site Link : https://www.oslead.xyz/usertype , so that ur points will be assigned to the leaderboard.
New to Open Source Contribution check out the below YT video , Happy Coding🚀💻🐛
🔗 Link : https://www.youtube.com/watch?v=3afUKB3guZA"
pr-message: "Great job, @${{ github.actor }}! 🎉 Thank you for submitting your pull request. Your contribution is valuable and we appreciate your efforts to improve our project.We will promptly review your changes and offer feedback. Keep up the excellent work!"

4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"liveServer.settings.port": 5504
"liveServer.settings.port": 5504,
"IDX.aI.enableInlineCompletion": true,
"IDX.aI.enableCodebaseIndexing": true
}
Loading

0 comments on commit 0f7b74f

Please sign in to comment.