Skip to content

Commit

Permalink
Added prettier on the workflow (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cassidy-Boilley committed May 9, 2024
1 parent b5480bc commit 7b25ff1
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Format
on:
pull_request:
branches: [Devops/WorkFlows]
push:
branches: [Devops/WorkFlows]

jobs:
format:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.ACTIONS_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: "20.x"
token: ${{ secrets.ACTIONS_TOKEN }}
- run: npm ci
- run: npm run format

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply formatting changes
branch: ${{ github.head_ref }}

# - name: Notify failure
# if: failure()
# uses: actions/github-script@v4
# with:
# github-token: ${{ secrets.ACTIONS_TOKEN }}
# script: |
# github.issues.createComment({
# issue_number: context.issue.number,
# owner: context.repo.owner,
# repo: context.repo.repo,
# body: 'Formatting failed. Please check the logs.'
# })
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",
"prepare": "husky"
"prepare": "husky",
"format": "prettier --write ."
},
"lint-staged": {
"**/*": [
Expand Down

0 comments on commit 7b25ff1

Please sign in to comment.