From 26fd95c5c4a5e78200274b306413e07c7def1b8d Mon Sep 17 00:00:00 2001 From: TymanWasTaken Date: Tue, 18 May 2021 23:59:12 -0400 Subject: make github actions format code for me --- .github/workflows/nodejs.yml | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) (limited to '.github') diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 004fa75..2a0beaa 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -12,16 +12,12 @@ jobs: Test: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [14.x, 15.x] - steps: - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} + - name: Use Node.js 14.x uses: actions/setup-node@v1 with: - node-version: ${{ matrix.node-version }} + node-version: 14.x - name: Install dependencies run: yarn - name: Fix config @@ -30,5 +26,32 @@ jobs: run: yarn lint - name: Test Build run: yarn build - - name: Test formatting - run: yarn prettier --check . + + Check-Formatting: + runs-on: ubuntu-latest + name: Check formatting + + steps: + - uses: actions/checkout@v2 + with: + persist-credentials: false + fetch-depth: 0 + - name: Use Node.js 14.x + uses: actions/setup-node@v1 + with: + node-version: 14.x + - name: Install dependencies + run: yarn + - name: Configure git + run: | + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + - name: Format and commit code if needed + run: | + yarn format + git commit -am "Automatically format code" + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.ref }} -- cgit