Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
chahak-navneet authored Dec 17, 2024
0 parents commit 4041d46
Show file tree
Hide file tree
Showing 204 changed files with 30,605 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.git
Dockerfile
CHANGELOG.md
Procfile
README.md
docs
http
jest.config.js
.eslintrc.js
.github
.gitignore
.prettierrc
Dockerrun.aws.json.tpl
Dockerrun.aws.json
25 changes: 25 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'prettier/@typescript-eslint',
],
root: true,
env: {
node: true,
jest: true,
},
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
};
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: ":arrow_up: "
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: ":arrow_up: "
12 changes: 12 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
config:
- ./*
tooling:
- tooling/**/*.*
assets:
- static/**/*.*
tests:
- any: ["src/**/*.spec.js", "cypress/**/*"]
package:
- any: ["package.json", "package-lock.json"]
source:
- src/**/*
35 changes: 35 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Merge PRs
on:
pull_request:
types:
- labeled
- synchronize
- opened
- edited
- ready_for_review
- reopened
- unlocked
pull_request_review:
types:
- submitted
jobs:
automerge:
runs-on: ubuntu-latest
steps:
- name: Automerge
uses: pascalgn/[email protected]
env:
GITHUB_TOKEN: "${{ secrets.GH_PAT }}"
MERGE_LABELS: "merge,!work in progress,!wip"
MERGE_REMOVE_LABELS: "merge"
MERGE_METHOD: "merge"
MERGE_COMMIT_MESSAGE: ":twisted_rightwards_arrows: Merge #{pullRequest.number} ({pullRequest.title})"
MERGE_FORKS: false
UPDATE_LABELS: "merge"
UPDATE_METHOD: "merge"
- name: Delete merged branch
uses: koj-co/delete-merged-action@master
with:
branches: "!master, !production, *"
env:
GITHUB_TOKEN: "${{ secrets.GH_PAT }}"
35 changes: 35 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CodeQL CI
on:
schedule:
- cron: '0 0 * * 1'
jobs:
release:
name: Build and analyze
runs-on: ubuntu-18.04
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: 14
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: javascript
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm ci
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
15 changes: 15 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Dependabot PR CI
on:
schedule:
- cron: "0 */6 * * *"
workflow_dispatch:
jobs:
label-approve:
name: Label and approve minor/patch updates
runs-on: ubuntu-18.04
steps:
- uses: koj-co/dependabot-pr-action@master
with:
token: ${{ secrets.GH_PAT }}
merge-minor: true
merge-patch: true
18 changes: 18 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Pull Request Labeler
on:
- pull_request
- pull_request_review
jobs:
triage:
runs-on: ubuntu-latest
steps:
- name: Label all PRs
uses: actions/labeler@master
with:
repo-token: "${{ secrets.GH_PAT }}"
- name: Label approved PRs
uses: koj-co/label-approved-action@master
with:
labels: "merge"
env:
GITHUB_TOKEN: "${{ secrets.GH_PAT }}"
82 changes: 82 additions & 0 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Node CI
on:
push:
branches:
- master
jobs:
test:
name: Build, test, and release
if: "!contains(github.event.head_commit.message, '[skip ci]')"
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
node: [14]
runs-on: ${{ matrix.os }}
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: api-test
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: ${{ matrix.node }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ matrix.os }}-${{ matrix.node }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.node }}-${{ env.cache-name }}-
${{ matrix.os }}-${{ matrix.node }}-
${{ matrix.os }}-
- name: Install dependencies
run: npm ci
- name: Build TypeScript
run: npm run build
- name: Run tests
run: npm run test
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
release:
name: Release
runs-on: ubuntu-20.04
needs: [test]
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: ${{ matrix.node }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ matrix.os }}-${{ matrix.node }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.node }}-${{ env.cache-name }}-
${{ matrix.os }}-${{ matrix.node }}-
${{ matrix.os }}-
- name: Install dependencies
run: npm ci
- name: Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_AUTHOR_NAME: 'FindingAnand'
GIT_AUTHOR_EMAIL: '[email protected]'
GIT_COMMITTER_NAME: 'FindingAnand'
GIT_COMMITTER_EMAIL: '[email protected]'
73 changes: 73 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: PR Generator CI
on:
push:
branches-ignore:
- master
- production
jobs:
auto-pull-request:
name: PullRequestAction
runs-on: ubuntu-latest
steps:
- name: Generate branch name
uses: actions/github-script@v3
id: set-branch-name
with:
script: |
const capitalize = (name) => name.charAt(0).toUpperCase() + name.slice(1);
const emoji = context.payload.ref.startsWith("refs/heads/feature")
? "✨ "
: context.payload.ref.startsWith("refs/heads/hotfix")
? "🚑 "
: context.payload.ref.startsWith("refs/heads/bug")
? "🐛 "
: "";
return `${emoji}${capitalize(
context.payload.ref
.replace("refs/heads/", "")
.replace(/-/g, " ")
.replace("feature ", "")
.replace("bug ", "")
.replace("hotfix ", "")
)}`;
result-encoding: string
- name: Set branch name
run: echo "PULL_REQUEST_TITLE=${{steps.set-branch-name.outputs.result}}" >> $GITHUB_ENV
- name: Generate PR body
uses: actions/github-script@v3
id: set-pr-body
with:
script: |
return `I'm opening this pull request for this branch, pushed by @${
context.payload.head_commit.author.username
} with ${context.payload.commits.length} commit${
context.payload.commits.length === 1 ? "" : "s"
}.`;
result-encoding: string
- name: Set PR body
run: echo "PULL_REQUEST_BODY=${{steps.set-pr-body.outputs.result}}" >> $GITHUB_ENV
- name: Generate PR draft
uses: actions/github-script@v3
id: set-pr-draft
with:
script: |
return !context.payload.ref.startsWith("refs/heads/hotfix");
- name: Set PR draft
run: echo "PULL_REQUEST_DRAFT=${{steps.set-pr-draft.outputs.result}}" >> $GITHUB_ENV
- name: Determine whether to merge
uses: actions/github-script@v3
id: should-pr
with:
github-token: ${{ secrets.GH_PAT }}
script: |
return
context.payload.ref.startsWith("refs/heads/feature") ||
context.payload.ref.startsWith("refs/heads/hotfix") ||
context.payload.ref.startsWith("refs/heads/bug");
- name: pull-request-action
uses: vsoch/[email protected]
if: always() && steps.should-pr.outputs.result
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
PULL_REQUEST_BRANCH: "master"
PULL_REQUEST_REVIEWERS: "AnandChowdhary"
13 changes: 13 additions & 0 deletions .github/workflows/release-scheduler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Release Scheduler CI
on:
schedule:
- cron: "0 0 * * 1"
workflow_dispatch:
jobs:
releaseScheduler:
runs-on: ubuntu-latest
steps:
- name: Run release-scheduler
uses: koj-co/release-scheduler@master
env:
GH_PAT: ${{ secrets.GH_PAT }}
19 changes: 19 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Stale Issues CI"
on:
schedule:
- cron: "0 0 * * *"
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GH_PAT }}
stale-issue-message: "⚠️ This issue has not seen any activity in the past 2 months so I'm marking it as stale. I'll close it if it doesn't see any activity in the coming week."
stale-pr-message: "⚠️ This PR has not seen any activity in the past 2 months so I'm marking it as stale. I'll close it if it doesn't see any activity in the coming week."
days-before-stale: 60
days-before-close: 7
stale-issue-label: "wontfix"
exempt-issue-labels: "wip"
stale-pr-label: "wontfix"
exempt-pr-labels: "wip"
Loading

0 comments on commit 4041d46

Please sign in to comment.