From 0bca16deb65861a0bcb6acc2f324f04e8540520d Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Tue, 17 Sep 2024 16:39:54 -0700 Subject: [PATCH] Only write formatted files in CI when not in a PR --- .github/workflows/javascript-format-test-build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/javascript-format-test-build.yml b/.github/workflows/javascript-format-test-build.yml index ba766936a..ea5f32a76 100644 --- a/.github/workflows/javascript-format-test-build.yml +++ b/.github/workflows/javascript-format-test-build.yml @@ -72,26 +72,26 @@ jobs: run: npm install - name: Lint and fix - if: steps.changed-files-yaml.outputs.src_any_changed == 'true' && github.repository == 'owncast/owncast' + if: steps.changed-files-yaml.outputs.src_any_changed == 'true' && github.event_name != 'pull_request' run: npx eslint --fix ${{ steps.changed-files-yaml.outputs.src_all_changed_files }} - name: Lint - if: steps.changed-files-yaml.outputs.src_any_changed == 'true' && github.repository != 'owncast/owncast' + if: steps.changed-files-yaml.outputs.src_any_changed == 'true' && github.event_name == 'pull_request' run: npx eslint --fix ${{ steps.changed-files-yaml.outputs.src_all_changed_files }} - name: Prettier formatting - if: steps.changed-files-yaml.outputs.src_any_changed == 'true' && github.repository == 'owncast/owncast' + if: steps.changed-files-yaml.outputs.src_any_changed == 'true' && github.event_name == 'pull_request' run: npx prettier --write ${{ steps.changed-files-yaml.outputs.src_all_changed_files }} - name: Prettier check - if: steps.changed-files-yaml.outputs.src_any_changed == 'true' && github.repository != 'owncast/owncast' + if: steps.changed-files-yaml.outputs.src_any_changed == 'true' && github.event_name != 'pull_request' run: npx prettier ${{ steps.changed-files-yaml.outputs.src_all_changed_files }} - name: Debug changed files output run: 'pwd && echo "Changed files: ${{ steps.changed-files-yaml.outputs.src_all_changed_files }}"' - name: Commit changes - if: steps.changed-files-yaml.outputs.src_any_changed == 'true' && github.repository == 'owncast/owncast' + if: steps.changed-files-yaml.outputs.src_any_changed == 'true' && github.event_name != 'pull_request' uses: EndBug/add-and-commit@v9 with: author_name: Owncast