From f1e8ea6671607f6d3be0247d6d9a5adc058d8d69 Mon Sep 17 00:00:00 2001 From: Stephan <57194608+stephan418@users.noreply.github.com> Date: Fri, 15 Oct 2021 15:28:37 +0200 Subject: [PATCH] Add action for format files --- .github/workflows/main.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..c621ff4 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,33 @@ +# This workflow runs Prettier and formats all files + +name: Format files using prettier + +on: + workflow_dispatch: + +jobs: + # Job to check the formatting + format: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '16' + + - name: Install prettier + run: npm i -g prettier + + - name: Format using prettier + run: prettier -w . + + - name: Make pull request + uses: peter-evans/create-pull-request@v3 + with: + commit-message: "[create-pull-request] push formatted files" + delete-branch: true + title: "Reformat files using prettier" + + +