Skip to content

Commit

Permalink
update format workflow to use same steps that precommit does
Browse files Browse the repository at this point in the history
  • Loading branch information
dbjorge committed Oct 19, 2023
1 parent eae2bcd commit 35c366a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@ name: Format
on: [pull_request]

jobs:
prettier:
autocorrect:
runs-on: ubuntu-latest
# Only run on PRs from non-forks
if: github.event.pull_request.head.repo.full_name == github.repository
steps:
- name: Cloning the repository
uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Prettify the code
uses: creyD/[email protected]
- uses: actions/setup-node@v3
with:
prettier_options: '--write .'
node-version: 18
- run: yarn install --no-lockfile
- run: yarn fmt
- run: yarn lint --fix
- uses: stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d # tag=v5
with:
commit_message: ':robot: Automated formatting fixes'
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-wdio": "^8.0.14",
"husky": "^8.0.1",
"prettier": "^2.7.1",
"prettier": "^3.0.3",
"typescript": "^5.0.4"
}
}

0 comments on commit 35c366a

Please sign in to comment.