From 4eb1a057f790ba5d44ec4df7ae3be2d8c14097ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adem=C3=ADlson=20F=2E=20Tonato?= Date: Sun, 17 Oct 2021 17:19:50 +0100 Subject: [PATCH 1/3] chore: update action to ensure we get the reference before running "prettier" --- .github/workflows/deploy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 516fdf9f..3ceebac9 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -20,6 +20,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + with: + # Make sure the actual branch is checked out when running on pull requests + ref: ${{ github.head_ref }} - name: Prettify code uses: creyD/prettier_action@v4.0 From 3db50006c3737e6308daff96bcea24bb5debf2ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adem=C3=ADlson=20F=2E=20Tonato?= Date: Sun, 17 Oct 2021 23:06:34 +0100 Subject: [PATCH 2/3] chore: update the "prettier" process to take into account only certain file types --- .github/workflows/deploy.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3ceebac9..872e1d9e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -22,10 +22,16 @@ jobs: uses: actions/checkout@v2 with: # Make sure the actual branch is checked out when running on pull requests - ref: ${{ github.head_ref }} + ref: ${{ github.event.pull_request.base.ref }} + + # This is important to fetch the changes to the previous commit + fetch-depth: 0 - name: Prettify code uses: creyD/prettier_action@v4.0 + with: + prettier_options: --write src/**/*.{js,json,md} + only_changed: True build: # The type of runner that the job will run on if: github.event_name != 'pull_request' From 4d72459d961d721f6049b80b0562b1409dbce0b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adem=C3=ADlson=20F=2E=20Tonato?= Date: Mon, 18 Oct 2021 09:21:21 +0100 Subject: [PATCH 3/3] chore: add new type of files to be considered by prettier --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 872e1d9e..04d4c6d2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -30,7 +30,7 @@ jobs: - name: Prettify code uses: creyD/prettier_action@v4.0 with: - prettier_options: --write src/**/*.{js,json,md} + prettier_options: "src/**/*.{ts,jsx,js,css,html,json,md}" --write only_changed: True build: # The type of runner that the job will run on