Skip to content

Commit

Permalink
Merge branch 'ajay-dhangar:main' into new_branch_6
Browse files Browse the repository at this point in the history
  • Loading branch information
haseebzaki-07 authored Oct 13, 2024
2 parents af1be8a + d4acee0 commit 3e53cd2
Show file tree
Hide file tree
Showing 35 changed files with 3,922 additions and 86 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/greeting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: "Auto Greeting for Issues and PRs"

on:
issues:
types: [opened]
pull_request_target:
types: [opened]

permissions:
issues: write
pull-requests: write

jobs:
greeting:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Greet first-time contributors
id: greet
uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: |
👋 Hi @${{ github.actor }}! Thank you for opening your first issue on the Algo project. We're excited to help you out and appreciate your contribution. Please provide as much detail as possible to assist us in addressing the issue effectively.
Welcome aboard! 😊
pr-message: |
👋 Hi @${{ github.actor }}! Thank you for submitting your first pull request to the Algo project. Great job on the contribution! 🎉 We appreciate your efforts, and our team will review it soon. If you have any questions, feel free to ask. Keep up the great work! 🚀
- name: Assign issue or pull request to a team member
if: github.event_name == 'issues' || github.event_name == 'pull_request_target'
run: |
ISSUE_NUMBER=${{ github.event.issue.number || github.event.pull_request.number }}
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-d '{"assignees":["team-member-username"]}' \
"https://api.github.com/repos/${{ github.repository }}/issues/${ISSUE_NUMBER}"
- name: Welcome message for community contributors
if: github.event_name == 'issues' || github.event_name == 'pull_request_target'
uses: EddieHubCommunity/gh-action-community/src/welcome@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "👋 Hi @${{ github.actor }}! Thanks for opening this issue. We appreciate your contribution to the Algo project. Our team will review it soon."
pr-message: "🎉 Great job, @${{ github.actor }}! Thank you for submitting your pull request. We appreciate your contribution, and our team will review it shortly."

- name: Label first-time issues
if: github.event_name == 'issues'
run: |
ISSUE_NUMBER=${{ github.event.issue.number }}
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-d '{"labels":["Algo Contributor's Issue"]}' \
"https://api.github.com/repos/${{ github.repository }}/issues/${ISSUE_NUMBER}"
- name: Label first-time pull requests
if: github.event_name == 'pull_request_target'
run: |
PR_NUMBER=${{ github.event.pull_request.number }}
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-d '{"labels":["Algo Contributor's PR"]}' \
"https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}"
68 changes: 68 additions & 0 deletions .github/workflows/lighthouse-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Lighthouse Report

on:
pull_request_target:
branches:
- main
- algo-v**

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
lighthouse-report:
permissions:
pull-requests: write # for marocchino/sticky-pull-request-comment
name: Lighthouse Report
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]

- name: Use Node.js
uses: actions/[email protected]
with:
node-version: 20

- name: Install dependencies
run: npm ci

- name: Build website
run: npm run build

- name: Audit URLs using Lighthouse
id: lighthouse_audit
uses: treosh/[email protected]
with:
urls: |
http://localhost:3000/algo/
http://localhost:3000/algo/docs
http://localhost:3000/algo/blog
configPath: ./.github/workflows/lighthouserc.json
uploadArtifacts: true
temporaryPublicStorage: true

- name: Format lighthouse score
id: format_lighthouse_score
uses: actions/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const results = ${{ steps.lighthouse_audit.outputs.manifest }}
const links = ${{ steps.lighthouse_audit.outputs.links }}
const createLighthouseReport = (await import(`${process.env.GITHUB_WORKSPACE}/admin/scripts/formatLighthouseReport.js`)).default;
const comment = createLighthouseReport({ results, links });
core.setOutput("comment", comment);
- name: Add Lighthouse stats as comment
id: comment_to_pr
uses: marocchino/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
number: ${{ github.event.pull_request.number }}
header: lighthouse
message: ${{ steps.format_lighthouse_score.outputs.comment }}
20 changes: 20 additions & 0 deletions .github/workflows/lighthouserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"ci": {
"collect": {
"startServerCommand": "npm run serve",
"startServerReadyPattern": "Serving",
"startServerReadyTimeout": 10000,
"numberOfRuns": 1,
"settings": {
"skipAudits": [
"robots-txt",
"canonical",
"tap-targets",
"is-crawlable",
"works-offline",
"offline-start-url"
]
}
}
}
}
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

Thank you for your interest in contributing to **Algo**! We welcome contributions from everyone, whether you're a beginner or an experienced developer.

## Resources for Guidance
Here are some resources that may be helpful as you contribute to Algo:
- [Docusaurus Documentation](https://docusaurus.io/docs/docs-introduction)
- [React.js Documentation](https://legacy.reactjs.org/docs/getting-started.html)
- [Markdown Guide](https://www.markdownguide.org/)
- [MDX Documentation](https://mdxjs.com/docs/)
- [Mermaid Documentation](https://mermaid.js.org/)

## How to Contribute

### 1. Fork the Repository
Expand Down
Loading

0 comments on commit 3e53cd2

Please sign in to comment.