This commit is contained in:
43
.gitea/workflows/autofix.ci.yaml
Normal file
43
.gitea/workflows/autofix.ci.yaml
Normal file
@@ -0,0 +1,43 @@
|
||||
# Check and format a branch on a pull request created.
|
||||
name: autofix.ci
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
prepare:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
run: |
|
||||
GITEA_HOST="${GITEA_HOST_IP:-172.20.0.1}"
|
||||
git clone --depth 1 "http://oauth2:${GITHUB_TOKEN}@${GITEA_HOST}:3000/${{ github.repository }}.git" .
|
||||
git fetch --depth 1 origin "${{ github.sha }}"
|
||||
git checkout -q "${{ github.sha }}"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
GITEA_HOST_IP: ${{ secrets.GITEA_HOST_IP }}
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10.30.3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Lint
|
||||
run: pnpm run lint
|
||||
|
||||
- name: Format
|
||||
run: pnpm run fmt
|
||||
|
||||
- uses: autofix-ci/action@v1
|
||||
Reference in New Issue
Block a user