diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 318a41d..3d96503 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -2,13 +2,13 @@ name: CI on: [pull_request] - + permissions: read-all jobs: - eslint: + eslint: runs-on: ubuntu-latest - steps: + steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: @@ -21,7 +21,7 @@ jobs: reporter: github-pr-review fail_on_error: false eslint_flags: '**/*.{js,jsx}' - + detect-secrets: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/scripts/reviewReviewed.js b/.github/workflows/scripts/reviewReviewed.js index 9d83536..9dd2f44 100644 --- a/.github/workflows/scripts/reviewReviewed.js +++ b/.github/workflows/scripts/reviewReviewed.js @@ -40,11 +40,11 @@ const messageAssignee = async ({ context }) => { try { const UserModel = getUserModel(); const slackAssignees = await Promise.allSettled( - githubAssignees.map(assignee => UserModel.findOne({ github: assignee.login })), + githubAssignees.map((assignee) => UserModel.findOne({ github: assignee.login })), ); if (context.payload.review.state === 'approved') { await Promise.all( - slackAssignees.map(assignee => + slackAssignees.map((assignee) => Bot.client.chat.postMessage({ channel: assignee.value?.slackId, text: `One of your pull requests has been APPROVED by ${reviewer}! <${url}|View Review> :shrek::thumbsup:`, @@ -53,7 +53,7 @@ const messageAssignee = async ({ context }) => { ); } else { await Promise.all( - slackAssignees.map(assignee => + slackAssignees.map((assignee) => Bot.client.chat.postMessage({ channel: assignee.value?.slackId, text: `One of your pull requests has been REVIEWED by ${reviewer}! <${url}|View Review> :shrek:`, diff --git a/server/schema/users.sql b/server/schema/users.sql new file mode 100644 index 0000000..b652586 --- /dev/null +++ b/server/schema/users.sql @@ -0,0 +1,10 @@ +CREATE TYPE account_type as ENUM ('superadmin', 'admin'); + +DROP TABLE IF EXISTS users; + +CREATE TABLE users ( + id VARCHAR ( 256 ) PRIMARY KEY, + email VARCHAR ( 50 ) NOT NULL, + type account_type NOT NULL, + approved BOOLEAN NOT NULL +); \ No newline at end of file