0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00
astro/.github/workflows/format.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
1 KiB
YAML
Raw Normal View History

name: "Format Code"
2021-03-26 14:45:53 -05:00
on:
2023-03-01 09:02:35 -05:00
workflow_dispatch:
2021-03-26 14:45:53 -05:00
push:
branches:
- main
jobs:
format:
2023-03-14 08:57:56 -05:00
if: github.repository_owner == 'withastro'
2021-03-26 14:45:53 -05:00
runs-on: ubuntu-latest
env:
NODE_OPTIONS: "--max_old_space_size=4096"
2021-03-26 14:45:53 -05:00
steps:
2021-11-02 09:13:36 -05:00
- name: Check out code using Git
uses: actions/checkout@v3
2021-03-26 14:45:53 -05:00
with:
ref: ${{ github.head_ref }}
2022-06-27 13:11:19 -05:00
# Needs access to push to main
token: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
- name: Setup PNPM
uses: pnpm/action-setup@v2
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: "pnpm"
- name: Install dependencies
run: pnpm install
2021-11-02 09:13:36 -05:00
- name: Format code
run: pnpm run format:ci
2021-03-26 14:45:53 -05:00
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "[ci] format"
2021-03-26 14:45:53 -05:00
branch: ${{ github.head_ref }}
commit_user_name: fredkbot
commit_user_email: fred+astrobot@astro.build