-
-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ajay-dhangar:main' into new_branch_6
- Loading branch information
Showing
35 changed files
with
3,922 additions
and
86 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
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}" |
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,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 }} |
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,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" | ||
] | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.