Enhance Terms & Conditions page design for better readability and visual consistency #61
This file contains hidden or 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
| name: Auto Label and Comment Issues | |
| on: | |
| issues: | |
| types: [opened] | |
| permissions: | |
| issues: write | |
| jobs: | |
| label-and-comment: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Add gssoc26 label and welcome comment to new issues | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| // Add the gssoc26 label | |
| await github.rest.issues.addLabels({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| labels: ['gssoc26'] | |
| }); | |
| // Only comment if the creator is not the repository owner | |
| if (context.actor !== 'Aditya948351') { | |
| const { data: issues } = await github.rest.issues.listForRepo({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| creator: context.actor, | |
| state: 'all' | |
| }); | |
| // Filter to only include actual issues, not PRs | |
| const actualIssues = issues.filter(issue => !issue.pull_request); | |
| let message = ''; | |
| if (actualIssues.length <= 1) { | |
| // First time issue creator | |
| message = `Welcome to DevPath Community's Official Repository! π Thank you for bringing this up and starting your contributions to our project. \n\nPlease do star β the repo and keep growing in your Open Source Journey! π\n\n@${context.actor}, @Aditya948351 or @devpathindcommunity-india will review this and assign you this issue ASAP by checking if it is really needed for the website.\n\n---\n**Follow the Community Here:** https://www.linkedin.com/company/devpath-community/`; | |
| } else { | |
| // Returning contributor | |
| const quotes = [ | |
| "\"The only way to do great work is to love what you do.\" β Steve Jobs", | |
| "\"Code is like humor. When you have to explain it, itβs bad.\" β Cory House", | |
| "\"First, solve the problem. Then, write the code.\" β John Johnson", | |
| "\"Experience is the name everyone gives to their mistakes.\" β Oscar Wilde", | |
| "\"Make it work, make it right, make it fast.\" β Kent Beck", | |
| "\"Continuous improvement is better than delayed perfection.\" β Mark Twain", | |
| "\"Any fool can write code that a computer can understand. Good programmers write code that humans can understand.\" β Martin Fowler" | |
| ]; | |
| const randomQuote = quotes[Math.floor(Math.random() * quotes.length)]; | |
| message = `Welcome back, @${context.actor}! Thanks for opening another issue. Our maintainers will review it shortly.\n\nHere is your motivating thought for the day:\n> ${randomQuote}`; | |
| } | |
| await github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: message | |
| }); | |
| } |