Skip to content

Commit

Permalink
feat(workflows): add new push checks workflow
Browse files Browse the repository at this point in the history
A new workflow for push checks has been added, which includes several steps such as code checkout, pnpm installation, dependencies installation, and code formatting with Biome. Git auto commit function for lint fixes is also incorporated in the new workflow.
  • Loading branch information
suddenlyGiovanni committed Apr 4, 2024
1 parent 52fcfcf commit a07fc93
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/push-checks-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: πŸš€ Push Checks Workflow
on:
push:
branches-ignore:
- main
workflow_dispatch:

jobs:
checks:
name: 🫸 Push Checks
runs-on: ubuntu-latest

steps:
- name: πŸ“₯ Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: πŸ“¦ Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8
run_install: false

- name: πŸ› οΈ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: current
cache: "pnpm"

- name: 🧩 Install dependencies
run: pnpm install --frozen-lockfile --prod=false

- name: πŸ‘£ Retrieve Git REF
run: echo "GIT_REF=$(git rev-parse origin/main)" >> $GITHUB_ENV

- name: πŸ› Debug Git REF
run: echo "${{ env.GIT_REF }}"

- name: πŸ’… Format code (with Biome)
continue-on-error: true
run: |
pnpm exec biome check \
--apply \
--changed \
--since=${{ env.GIT_REF }} \
--formatter-enabled=true \
--linter-enabled=false \
--organize-imports-enabled=true \
--vcs-enabled=true \
--vcs-use-ignore-file=true \
--no-errors-on-unmatched \
--diagnostic-level=info \
--log-level=warn \
.
- name: 🚦 Git Auto Commit Lint fixes (with Biome)
uses: stefanzweifel/[email protected]
with:
commit_message: "chore: lint code with Biome [skip ci]"

0 comments on commit a07fc93

Please sign in to comment.