From 2d45a00974b56ef757303f3f11d20a26fc2d497f Mon Sep 17 00:00:00 2001 From: el-rabies Date: Thu, 26 Feb 2026 14:25:56 -0500 Subject: [PATCH] Updated Pipelines --- .github/workflows/prettier.yml | 28 +++++++++++++++++++++++----- .prettierignore | 1 + 2 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 .prettierignore diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index 8b62c5b..4154fdc 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -2,16 +2,34 @@ name: autofix.ci on: pull_request: push: -permissions: {} + +permissions: + contents: write + jobs: prettier: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 # important so git diff works + - uses: actions/setup-node@v4 - - run: | - yarn - yarn prettier . --write + + - name: Install deps + run: yarn + + - name: Run prettier on changed files + run: | + CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD \ + | grep -E '\.(ts|tsx|js|jsx|json|md|yaml|yml|css|scss)$' || true) + + if [ -n "$CHANGED_FILES" ]; then + echo "$CHANGED_FILES" | xargs yarn prettier --write + else + echo "No files to format" + fi + - uses: autofix-ci/action@v1 with: - commit-message: "Apply Prettier format" + commit-message: "Apply Prettier format" \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..b45101c --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +.github/** \ No newline at end of file