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