Skip to content

Commit

Permalink
Add format check command and github action. (#9)
Browse files Browse the repository at this point in the history
* Add format check command and github action.

* Fix github action.
  • Loading branch information
gasher authored Jan 18, 2024
1 parent 9fadeec commit 5f8736c
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/format-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: format-check

# Controls when the workflow will run
on:
pull_request:
branches:
- master
- main

# Auto cancels previous running CI jobs in this PR on each new commit
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
format-check:
runs-on: ubuntu-latest-m
env:
NODE_VERSION: 19.x

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install dependencies
run: npm ci

- name: Format check
run: npm run format-check
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"format": "dprint fmt && next lint --fix"
"format": "dprint fmt && next lint --fix",
"format-check": "dprint check && next lint"
},
"dependencies": {
"autoprefixer": "^10.4.7",
Expand Down
5 changes: 4 additions & 1 deletion pages/onboarding.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ const OnboardingSuccess = ({ handleSubmit }) => (
export default function Onboarding() {
const [isSubmitted, setIsSubmitted] = useState(false);
const [holderDID] = useLocalStorage('holderDID', process.env.NEXT_PUBLIC_HOLDER_DID);
const [recipientEmail] = useLocalStorage('recipientEmail', process.env.NEXT_PUBLIC_RECIPIENT_EMAIL);
const [recipientEmail] = useLocalStorage(
'recipientEmail',
process.env.NEXT_PUBLIC_RECIPIENT_EMAIL
);
const router = useRouter();

const handleFormSubmit = async (event) => {
Expand Down

0 comments on commit 5f8736c

Please sign in to comment.