diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..899195e --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,27 @@ + +## Related Issue +[Cite any related issue(s) this pull request addresses. If none, simply state “None”] + +## Description +[Please include a brief description of the changes or features added] + +## Type of PR + +- [ ] Bug fix +- [ ] Feature enhancement +- [ ] Documentation update +- [ ] Other (specify): _______________ + +## Screenshots / videos (if applicable) +[Attach any relevant screenshots or videos demonstrating the changes] + +## Checklist: +- [ ] I have performed a self-review of my code +- [ ] I have read and followed the Contribution Guidelines. +- [ ] I have tested the changes thoroughly before submitting this pull request. +- [ ] I have provided relevant issue numbers, screenshots, and videos after making the changes. +- [ ] I have commented my code, particularly in hard-to-understand areas. + + +## Additional context: +[Include any additional information or context that might be helpful for reviewers.] diff --git a/.github/workflows/PR-template.md b/.github/workflows/PR-template.md new file mode 100644 index 0000000..1d6c602 --- /dev/null +++ b/.github/workflows/PR-template.md @@ -0,0 +1,43 @@ + + +## Related Issue\* + +Closes #issue_number + + + +## Description + + + +## Screenshot Section + + + +## Demo Video Section\* + + + +## Checklist + + + + +- [ ] I have attached screenshot in screenshot section +- [ ] I have added video + +## Task + +- [ ] Follow Us On social media - LinkedIn Twitter + Let's connect +- [ ] GitHub + +## Enter you User Id's: + +LinkedIn: +
GitHub: +
Discord: + +If you Follow us in both social medias we provide 'level2' +\*Only First time \ No newline at end of file diff --git a/.github/workflows/autocomment-iss-close.yml b/.github/workflows/autocomment-iss-close.yml new file mode 100644 index 0000000..8633a9a --- /dev/null +++ b/.github/workflows/autocomment-iss-close.yml @@ -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.MY_SECRET_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 + }); \ No newline at end of file diff --git a/.github/workflows/close-old-issue.yml b/.github/workflows/close-old-issue.yml new file mode 100644 index 0000000..a4c6bed --- /dev/null +++ b/.github/workflows/close-old-issue.yml @@ -0,0 +1,46 @@ +name: Close Old Issues + +on: + schedule: + - cron: "0 0 * * *" # Runs daily at midnight + +jobs: + close-issues: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Close Old Issues + env: + GITHUB_TOKEN: ${{ secrets.MY_SECRET_TOKEN }} + run: | + # Fetch open issues + open_issues=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \ + "https://api.github.com/repos/${{ github.repository }}/issues?state=open&per_page=100" \ + | jq -r '.[] | select(.pull_request == null) | .number') + + for issue in $open_issues; do + # Get the last updated timestamp of the issue + last_updated=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \ + "https://api.github.com/repos/${{ github.repository }}/issues/$issue" \ + | jq -r '.updated_at') + + # Calculate days since the last update + days_since_update=$(( ( $(date +%s) - $(date -d "$last_updated" +%s) ) / 86400 )) + + if [ $days_since_update -gt 30 ]; then + # Close the issue + curl -s -X PATCH -H "Authorization: token $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 why the issue was closed + curl -s -X POST -H "Authorization: token $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 diff --git a/.github/workflows/close-old-pr.yml b/.github/workflows/close-old-pr.yml new file mode 100644 index 0000000..5d938ee --- /dev/null +++ b/.github/workflows/close-old-pr.yml @@ -0,0 +1,32 @@ +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 + steps: + - name: Close Stale PRs + 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: 1 + exempt-pr-author: false + exempt-pr-labels: '' + only-labels: '' + operations-per-run: 30 + remove-stale-when-updated: true + debug-only: false diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml new file mode 100644 index 0000000..af27666 --- /dev/null +++ b/.github/workflows/development.yml @@ -0,0 +1,17 @@ +name: Development CI/CD + +on: + pull_request: + branches: [dev] + types: [opened, synchronize, reopened, edited, ready_for_review] + +jobs: + prettier: + uses: ./.github/workflows/prettier.yml + with: + fail-on-error: true + + eslint: + uses: ./.github/workflows/eslint.yml + with: + fail-on-error: true \ No newline at end of file