Skip to content

Commit

Permalink
feat: 💚 add in review checks (#4)
Browse files Browse the repository at this point in the history
* feat: 💚 add in alex

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* 🔀 feat: 👷 add in annotations for super linter

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 update ci workflows

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 more yaml errors

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* chore: 💚 update name of workflow

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 one more attempt for labeler

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 update with dependencies

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 separate out job

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 clean up workflows

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* feat: 👷 update with review action

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 bad formed action

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 review build job

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 update ci build to fix reviewdog

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* chore: 🚨 fix linter complaints

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 more fixes

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 remove checks that aren't setup

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 labeler

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* feat: 💚 add in action lint

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 fix labeler

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

---------

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>
  • Loading branch information
iamnewton authored Oct 25, 2024
1 parent c47a60a commit 363e26e
Show file tree
Hide file tree
Showing 15 changed files with 295 additions and 111 deletions.
23 changes: 0 additions & 23 deletions .ecrc

This file was deleted.

14 changes: 7 additions & 7 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ documentation:
- any:
- changed-files:
- any-glob-to-any-file:
- docs/*
- '**/*.md'
- docs/**
- "**/*.md"

# Add "bug" label to any PR where the head branch name starts with `fix` with file changes to src directory
bug:
- all:
- changed-files:
- any-glob-to-any-file: src/*
- head-branch: "^fix-"
- any-glob-to-any-file: src/**
- head-branch: "^fix-"

# Add "enhancement" label to any PR where the head branch name starts with `feat` with file changes to src directory
enhancement:
- all:
- changed-files:
- any-glob-to-any-file: src/*
- head-branch: "^feat-"
- any-glob-to-any-file: src/**
- head-branch: "^feat-"

# Add "release" label to any PR that is opened against the `main` branch
release:
- all:
- changed-files:
- any-glob-to-any-file: .changeset/*
- base-branch: "main"
- base-branch: "main"
5 changes: 5 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Audit

# @TODO: add in more things like:
# - [ ] performance checks (using yellowpages, googles tools, etc)
# - [ ] dead css checks
# - [ ] coverage drops

on:
pull_request:
types:
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/bookkeeping-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Issues Bookkeeping

# @TODO: add in more things like:
# - [ ] auto-assigning,
# - [ ] project assignments,
# - [ ] milestone assignments
# - [ ] cleans up language
# - [ ] checks that template is filled out

on:
issues:
types:
- opened
- edited

permissions:
contents: read
issues: write

jobs:
label-issues:
name: Add Labels to Issues
runs-on: ubuntu-latest
steps:
- uses: github/issue-labeler@v3.4
with:
include-title: 1
include-body: 0
sync-labels: 1
configuration-path: .github/labeler.yml
enable-versioned-regex: 0
repo-token: ${{ github.token }}
32 changes: 32 additions & 0 deletions .github/workflows/bookkeeping-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: PR Bookkeeping

# @TODO: add in more things like:
# - [ ] auto-assigning,
# - [ ] project assignments,
# - [ ] milestone assignments
# - [ ] cleans up language
# - [ ] checks that template is filled out

on:
pull_request:
types:
- opened
- edited

permissions:
contents: read
pull-requests: write

jobs:
label-pr:
name: Add Labels to PRs
runs-on: ubuntu-latest
steps:
- uses: github/issue-labeler@v3.4
with:
include-title: 1
include-body: 0
sync-labels: 1
configuration-path: .github/labeler.yml
enable-versioned-regex: 0
repo-token: ${{ github.token }}
29 changes: 29 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
github-pages:
name: Publish Storybook to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
runs-on: ubuntu-latest
steps:
- uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3
id: deploy-github-pages
name: Publish Storybook to GitHub Pages
with:
build_command: npm run build:storybook
install_command: npm ci
path: storybook-static
environment:
name: github-pages
url: ${{ steps.deploy-github-pages.outputs.page_url }}

16 changes: 0 additions & 16 deletions .github/workflows/label.yml

This file was deleted.

5 changes: 4 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
name: Run Super Linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ANNOTATE_ONLY: true # Allow annotations in the PR
DISABLE_COMMENTS: false # Enable comments in the PR
IGNORE_GITIGNORED_FILES: true
LINTER_RULES_PATH: /
CSS_FILE_NAME: "stylelint.config.js"
Expand Down Expand Up @@ -74,7 +76,8 @@ jobs:
VALIDATE_NATURAL_LANGUAGE: true
VALIDATE_TSX: true
VALIDATE_TYPESCRIPT_PRETTIER: true
VALIDATE_YAML_PRETTIER: true
VALIDATE_YAML: true # turning on for now while prettier is broken
# VALIDATE_YAML_PRETTIER: true => turning it off because its writing 4 spaces instead of 2

- uses: stefanzweifel/git-auto-commit-action@v5
name: Commit and push linting fixes
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish

on:
release:
types:
- created

jobs:
github-packages:
name: Publish to GitHub Packages
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout repository

- uses: actions/setup-node@v4
name: Setup Node.js @v20
with:
cache: npm
node-version: 20.x
registry-url: https://npm.pkg.github.com/

- run: npm ci
name: Install dependencies
- run: npm ci

- run: npm publish
name: Publish to GitHub Packages
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
23 changes: 2 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
npm:
name: Publish to NPM
changeset-release:
name: Create a release
permissions:
contents: write # to create release
issues: write # to post issue comments
Expand All @@ -26,22 +26,3 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

github-pages:
name: Publish Storybook to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
runs-on: ubuntu-latest
steps:
- uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3
id: deploy-github-pages
name: Publish Storybook to GitHub Pages
with:
build_command: npm run build:storybook
install_command: npm ci
path: storybook-static
environment:
name: github-pages
url: ${{ steps.deploy-github-pages.outputs.page_url }}
71 changes: 71 additions & 0 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Review

on:
- push
- pull_request

jobs:
reviewdog:
name: Review PRs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout repository

- uses: actions/setup-node@v4
name: Setup Node.js @v20
with:
cache: npm
node-version: 20.x

- run: npm ci
name: Install dependencies

- uses: reviewdog/action-setup@v1
name: Install & setup ReviewDog
with:
reviewdog_version: latest # Optional. [latest,nightly,v.X.Y.Z]

- uses: reviewdog/action-gitleaks@v1
name: Detect secrets using Gitleaks
with:
reporter: github-pr-check

- uses: reviewdog/action-alex@v1
name: Check language using Alex
with:
reporter: github-pr-check # [github-pr-check,github-check,github-pr-review]
# GitHub Status Check won't become failure with warning.
# level: warning # [info,warning, error]

- uses: EPMatt/reviewdog-action-tsc@v1
name: Check types using TypeScript
with:
reporter: github-pr-check

- uses: reviewdog/action-stylelint@v1
name: Check CSS using StyleLint
with:
reporter: github-pr-check
stylelint_input: '**/*.css'

# need to setup textlint in the repo for this
# - uses: tsuyoshicho/action-textlint@v3
# name: Check text using TextLint
# with:
# reporter: github-pr-check

- uses: reviewdog/action-actionlint@v1
name: Check GitHub Actions using ActionLint
with:
reporter: github-pr-check

- uses: dotenv-linter/action-dotenv-linter@v2
name: Check environment variables using dotenv
with:
reporter: github-code-suggestions

- uses: reviewdog/action-yamllint@v1
name: Check YAML using YamlLint
with:
reporter: github-pr-check
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# react-template
# React Template

<description> used within the Galaxy.
A React template used within the Galaxy.

## Installation

Expand All @@ -10,11 +10,19 @@ npm install --save-dev @theholocron/react-template

## Usage

<!-- fill out the usage with examples -->
```typescript
import { Component, type ComponentProps } from "@theholocron/react-template";

function App (props: ComponentProps) {
return (
<Component {...props} />
);
}
```

## Documentation

<!-- document the api(s), or how to use with examples -->
The best way to find out what's available is to check out the [documentation site](https://docs.theholocron.dev/react-template/), but if you like digging through source code, then each component is typed via TypeScript.

**Note**

Expand Down
Loading

0 comments on commit 363e26e

Please sign in to comment.