From b075f20d926112f3c66481b2ec2fa01b05f9a71e Mon Sep 17 00:00:00 2001 From: Caralee Jackson Date: Mon, 8 Jul 2024 14:29:04 -0500 Subject: [PATCH] SYS-192 add github ci update permissions to allow for checkout of private repo in reusable workflow fixing issue comment Pr review stuff add codeowners and sync ci.yml fix lint script, updated format check and fix for naming consistency --- .github/workflows/ci.yml | 61 +++++++++++++++++++++++++++++++++------- CODEOWNERS | 13 +++++++++ package.json | 6 ++-- 3 files changed, 67 insertions(+), 13 deletions(-) create mode 100644 CODEOWNERS diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58d5b64..4597d44 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,8 @@ name: Node CI Workflow -# The parameters are defaulted at the org level but can be overridden on the repository. +# +# The parameters are defaulted at the org level but can be overridden on the repository. +# See the github-automation repo for more documentation +# on: push: branches: @@ -9,6 +12,16 @@ on: branches: - dev - main + issue_comment: + inputs: + workflowBranch: + description: 'Branch of the reusable workflow. Defaults to main, select dev for testing only.' + required: true + default: 'main' + type: choice + options: + - dev + - main workflow_dispatch: inputs: workflowBranch: @@ -19,18 +32,46 @@ on: options: - dev - main - -permissions: - issues: write - pull-requests: write - jobs: - ci-dev: + echo-inputs: + name: Repo Workflow Debugging + runs-on: ubuntu-latest + steps: + - name: Check Repo Vars + run: | + echo "*** Start - Check inputs in repo workflow ***" + echo "Node Version: ${{ vars.NODE_VERSION }}" + echo "Lint Required: ${{ vars.IS_LINT_REQUIRED }}" + echo "Format Check Required: ${{ vars.IS_FORMAT_CHECK_REQUIRED }}" + echo "Apply Patches Required: ${{ vars.IS_APPLY_PATCHES_REQUIRED }}" + echo "Unit Tests Required: ${{ vars.IS_UNIT_TESTS_REQUIRED }}" + echo "*** End - Check inputs in repo workflow ***" + ci-test-only: if: ${{ github.event.inputs.workflowBranch == 'dev' }} - uses: shardeum/github-automation/.github/workflows/node-ci-shared.yml@dev + uses: shardeum/github-automation/.github/workflows/reusable-node-ci.yml@dev + permissions: + issues: write + pull-requests: write + contents: write + with: + node-version: ${{ vars.NODE_VERSION }} + lint-required: ${{ vars.IS_LINT_REQUIRED == 'true' }} + format-check-required: ${{ vars.IS_FORMAT_CHECK_REQUIRED == 'true' }} + apply-patches-required: ${{ vars.IS_APPLY_PATCHES_REQUIRED == 'true' }} + unit-tests-required: ${{ vars.IS_UNIT_TESTS_REQUIRED == 'true' }} secrets: inherit - ci-main: + ci: if: ${{ github.event.inputs.workflowBranch == 'main' || !github.event.inputs.workflowBranch }} - uses: shardeum/github-automation/.github/workflows/node-ci-shared.yml@main + uses: shardeum/github-automation/.github/workflows/reusable-node-ci.yml@main + permissions: + issues: write + pull-requests: write + contents: write + with: + node-version: ${{ vars.NODE_VERSION }} + lint-required: ${{ vars.IS_LINT_REQUIRED == 'true' }} + format-check-required: ${{ vars.IS_FORMAT_CHECK_REQUIRED == 'true' }} + apply-patches-required: ${{ vars.IS_APPLY_PATCHES_REQUIRED == 'true' }} + unit-tests-required: ${{ vars.IS_UNIT_TESTS_REQUIRED == 'true' }} secrets: inherit diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..200b737 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,13 @@ +# CODEOWNERS file +# To add additional teams to any approval, include them on the same line separated by spaces +# It is best practice to assign a team as a code owner and not an invidual. +# Please submit requests for new teams to Systems and Automation + +# Global approval (all files) +# * @shardeum/team-name + +# Directory-level approval +/.github/ @shardeum/systems-and-automation + +# Specific file rules +# README.md @shardeum/team-name diff --git a/package.json b/package.json index c7e4ede..607c5e7 100644 --- a/package.json +++ b/package.json @@ -12,9 +12,9 @@ "compile": "tsc -p .", "prepare": "npm run compile", "pretest": "npm run compile", - "lint": "eslint './public/**/*.ts'", - "lint-windows": "eslint ./public/**/*.ts", - "format-check": "prettier --check './public/**/*.ts'" + "lint": "eslint \"./public/**/*.ts\"", + "format-check": "prettier --check './public/**/*.ts'", + "format-fix": "prettier --write './public/**/*.ts'" }, "repository": { "type": "git",