astro/.github/workflows/format.yml

35 lines
784 B
YAML
Raw Normal View History

2021-03-26 19:45:53 +00:00
name: 'Format Code'
on:
push:
branches:
- main
jobs:
format:
runs-on: ubuntu-latest
steps:
2021-11-02 14:13:36 +00:00
- name: Check out code using Git
uses: actions/checkout@v2
2021-03-26 19:45:53 +00:00
with:
ref: ${{ github.head_ref }}
2022-01-18 22:15:25 +00:00
- uses: pnpm/action-setup@v2.0.1
with:
version: 6.23.x
2021-11-02 14:13:36 +00:00
- name: Set Node version to 16
uses: actions/setup-node@v2
2021-03-26 19:45:53 +00:00
with:
2021-11-02 14:13:36 +00:00
node-version: 16
2022-01-18 22:15:25 +00:00
cache: 'pnpm'
2021-11-02 14:13:36 +00:00
- name: Install dependencies
2022-01-18 22:17:47 +00:00
run: pnpm install
env:
CI: true
2021-11-02 14:13:36 +00:00
- name: Format code
2022-01-18 22:15:25 +00:00
run: pnpm run format
2021-03-26 19:45:53 +00:00
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
2022-01-18 22:15:25 +00:00
commit_message: '[ci] format'
2021-03-26 19:45:53 +00:00
branch: ${{ github.head_ref }}