diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index 1320f8c..a320d90 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -1,26 +1,23 @@ -name: Prettier Check on Merge +name: Prettify on Merge on: - push: - branches: - - main + pull_request_target: + types: + - closed jobs: prettier: + if: ${{ github.event.pull_request.merged == true }} runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 with: - # Make sure the actual branch is checked out when running on pull requests - ref: ${{ github.head_ref }} + # Ensure the branch being merged is checked out + ref: ${{ github.event.pull_request.head.ref }} - name: Prettify code uses: creyD/prettier_action@v4.3 with: - # Specify which files or directories to format prettier_options: --write ./packages/core/**/* ./packages/cli/**/* - - # Optionally set the working directory if needed - # working_directory: ./ # Uncomment and adjust if your setup requires a specific directory