Skip to content

Commit

Permalink
feat: 👷 update build system
Browse files Browse the repository at this point in the history
Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>
  • Loading branch information
iamnewton committed Oct 22, 2024
1 parent 5835198 commit 5ba3781
Show file tree
Hide file tree
Showing 8 changed files with 2,592 additions and 2,817 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/common/super-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Super Linter

on:
workflow_call:

jobs:
storybook:
runs-on: ubuntu-latest
steps:
- name: Super-Linter
uses: super-linter/super-linter@v7.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IGNORE_GITIGNORED_FILES: true
CSS_FILE_NAME: "stylelint.config.js"
# EDITORCONFIG_FILE_NAME: ".editorconfig-checker.json"
FIX_CSS_PRETTIER: true
FIX_ENV: true
FIX_GRAPHQL_PRETTIER: true
FIX_HTML_PRETTIER: true
FIX_JAVASCRIPT_PRETTIER: true
FIX_JSON_PRETTIER: true
FIX_JSX_PRETTIER: true
FIX_MARKDOWN_PRETTIER: true
FIX_SHELL_SHFMT: true
FIX_TSX: true
FIX_TYPESCRIPT_PRETTIER: true
FIX_YAML_PRETTIER: true
# GITHUB_ACTIONS_CONFIG_FILE: "actionlint.yml"
# GITLEAKS_CONFIG: ".gitleaks.toml"
JAVASCRIPT_ES_CONFIG_FILE: "eslint.config.js"
# MARKDOWN_CONFIG_FILE: ".markdown-lint.yml"
# NATURAL_LANGUAGE_CONFIG_FILE: "textlintrc.js"
PRETTIER_CONFIG: "prettier.config.js"
TYPESCRIPT_ES_CONFIG_FILE: "eslint.config.js"
TYPESCRIPT_STANDARD_TSCONFIG_FILE: ${DEFAULT_WORKSPACE}/tsconfig.json
VALIDATE_CSS_PRETTIER: true
VALIDATE_DOCKERFILE: true
VALIDATE_EDITORCONFIG: true
VALIDATE_ENV: true
VALIDATE_GIT_COMMITLINT: true
VALIDATE_GIT_MERGE_CONFLICT_MARKERS: true
VALIDATE_GITHUB_ACTIONS: true
VALIDATE_GITLEAKS: true
VALIDATE_GRAPHQL_PRETTIER: true
VALIDATE_HTML_PRETTIER: true
VALIDATE_JAVASCRIPT_PRETTIER: true
VALIDATE_JSON_PRETTIER: true
VALIDATE_JSX_PRETTIER: true
VALIDATE_MARKDOWN_PRETTIER: true
VALIDATE_NATURAL_LANGUAGE: true
VALIDATE_TYPESCRIPT_PRETTIER: true
VALIDATE_YAML_PRETTIER: true
51 changes: 6 additions & 45 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Lint

on: # yamllint disable-line rule:truthy
push: null
pull_request: null
on:
- push
- pull_request

permissions:
contents: read
Expand All @@ -21,48 +21,9 @@ jobs:
with:
fetch-depth: 0

- name: Super-Linter
uses: super-linter/super-linter@v7.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IGNORE_GITIGNORED_FILES: true
CSS_FILE_NAME: "stylelint.config.js"
EDITORCONFIG_FILE_NAME: ".ecrc"
FIX_CSS_PRETTIER: true
FIX_ENV: true
FIX_GRAPHQL_PRETTIER: true
FIX_HTML_PRETTIER: true
FIX_JAVASCRIPT_PRETTIER: true
FIX_JSON_PRETTIER: true
FIX_JSX_PRETTIER: true
FIX_MARKDOWN_PRETTIER: true
FIX_SHELL_SHFMT: true
FIX_TSX: true
FIX_TYPESCRIPT_PRETTIER: true
FIX_YAML_PRETTIER: true
# GITHUB_ACTIONS_CONFIG_FILE: "actionlint.yml"
GITLEAKS_CONFIG: ".gitleaks.toml" # Path to your Gitleaks config if you have one
JAVASCRIPT_ES_CONFIG_FILE: "eslint.config.js"
MARKDOWN_CONFIG_FILE: ".markdown-lint.yml"
PRETTIER_CONFIG: "prettier.config.js"
TYPESCRIPT_ES_CONFIG_FILE: "eslint.config.js"
TYPESCRIPT_STANDARD_TSCONFIG_FILE: ${DEFAULT_WORKSPACE}/tsconfig.json
VALIDATE_CSS_PRETTIER: true
VALIDATE_DOCKERFILE: true
VALIDATE_EDITORCONFIG: true
VALIDATE_ENV: true
VALIDATE_GIT_COMMITLINT: true
VALIDATE_GIT_MERGE_CONFLICT_MARKERS: true
VALIDATE_GITHUB_ACTIONS: true
VALIDATE_GITLEAKS: true
VALIDATE_GRAPHQL_PRETTIER: true
VALIDATE_HTML_PRETTIER: true
VALIDATE_JAVASCRIPT_PRETTIER: true
VALIDATE_JSON_PRETTIER: true
VALIDATE_JSX_PRETTIER: true
VALIDATE_MARKDOWN_PRETTIER: true
VALIDATE_TYPESCRIPT_PRETTIER: true
VALIDATE_YAML_PRETTIER: true
- id: lint-super-linter
name: Run Super Linter
uses: ./.github/workflows/common/super-linter.yml

- name: Commit and push linting fixes
# Run only on:
Expand Down
12 changes: 12 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
#!/bin/sh

# Run GitLeaks to detect secrets
gitleaks git --no-banner

# Exit with non-zero if secrets are detected by GitLeaks
if [ $? -ne 0 ]; then
echo "Secrets detected by GitLeaks, aborting commit!"
exit 1
fi

# Run lint-staged with a custom config
npx lint-staged --config @theholocron/lint-staged-config
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ npm install --save-dev @theholocron/react-template
## Documentation

<!-- document the api(s), or how to use with examples -->

`brew install gitleaks`
Loading

0 comments on commit 5ba3781

Please sign in to comment.