This repository has been archived by the owner on Apr 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1475 from staart/feature-v3
Staart API v3
- Loading branch information
Showing
237 changed files
with
14,064 additions
and
20,919 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,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', | ||
}, | ||
}; |
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,10 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
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,12 @@ | ||
config: | ||
- ./* | ||
tooling: | ||
- tooling/**/*.* | ||
assets: | ||
- static/**/*.* | ||
tests: | ||
- any: ["src/**/*.spec.js", "cypress/**/*"] | ||
package: | ||
- any: ["package.json", "package-lock.json"] | ||
source: | ||
- src/**/* |
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,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/automerge-action@v0.12.0 | ||
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 }}" |
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,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 }}" |
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,60 @@ | ||
name: Node CI | ||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
release: | ||
name: Build, test, and release | ||
runs-on: ubuntu-18.04 | ||
if: "!contains(github.event.head_commit.message, '[skip ci]')" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2.3.4 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v2.1.2 | ||
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: Build TypeScript | ||
run: npm run build | ||
- name: Run tests | ||
run: npm run test | ||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v1 | ||
- name: Release | ||
run: npx semantic-release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_PAT }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GIT_AUTHOR_NAME: 'FindingAnand' | ||
GIT_AUTHOR_EMAIL: 'bot@anandchowdhary.com' | ||
GIT_COMMITTER_NAME: 'FindingAnand' | ||
GIT_COMMITTER_EMAIL: 'bot@anandchowdhary.com' | ||
- name: Add PR comment | ||
uses: actions/github-script@v3 | ||
if: always() && steps.licensed.outputs.pr_number | ||
with: | ||
github-token: ${{ secrets.GH_PAT }} | ||
script: | | ||
github.issues.createComment({ | ||
...context.repo, | ||
issue_number: ${{ steps.licensed.outputs.pr_number }} | ||
body: "I've checked the license of your new dependency and it looks good!" | ||
}) |
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,74 @@ | ||
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: | | ||
console.log(context.payload.ref); | ||
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/pull-request-action@1.0.11 | ||
if: always() && steps.should-pr.outputs.result | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_PAT }} | ||
PULL_REQUEST_BRANCH: 'master' | ||
PULL_REQUEST_REVIEWERS: 'AnandChowdhary' |
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,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 }} |
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,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" |
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 |
---|---|---|
@@ -1,20 +1,23 @@ | ||
name: Node CI | ||
on: [push] | ||
name: Test CI | ||
on: | ||
push: | ||
branches-ignore: | ||
- master | ||
jobs: | ||
release: | ||
name: Build and test | ||
runs-on: ubuntu-18.04 | ||
if: "!contains(github.event.head_commit.message, '[skip ci]')" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
uses: actions/checkout@v2.3.4 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v1 | ||
uses: actions/setup-node@v2.1.2 | ||
with: | ||
node-version: 12 | ||
node-version: 14 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Generate Prisma schema | ||
run: npx prisma generate | ||
- name: Build TypeScript | ||
run: npm run build | ||
- name: Run tests | ||
run: npm run test |
Oops, something went wrong.