Skip to content

Commit

Permalink
Restore prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-montalvo committed Aug 28, 2024
1 parent 6880844 commit 78d7ddc
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions .github/workflows/prettier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Prettier
# minimally modified from https://github.com/creyD/prettier_action#example-2-using-the-only_changed-or-same_commit-option-on-pr

on:
workflow_dispatch:
pull_request:
branches:
- main
Expand All @@ -16,22 +15,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}
# This is important to fetch the changes to the previous commit
fetch-depth: 0

- name: Check if PR is from a fork
id: check_fork
run: echo "::set-output name=is_fork::${{ github.event.pull_request.head.repo.fork }}"

- name: Prettify code
id: prettify
uses: creyD/[email protected]
with:
prettier_options: --write **/index.html --print-width 200
commit_message: "chore: prettier"
continue-on-error: true

- name: Handle commit failure
if: ${{ steps.prettify.outcome == 'failure' && steps.check_fork.outputs.is_fork == 'true' }}
run: echo "Commit failed due to lack of permissions. Please update permissions."

0 comments on commit 78d7ddc

Please sign in to comment.