Skip to content

Commit

Permalink
Merge pull request #2076 from w3c/egekorkan-patch-4
Browse files Browse the repository at this point in the history
Modifying Prettify to make a Dry run and check for Fork
  • Loading branch information
egekorkan authored Feb 12, 2025
2 parents c304598 + 0d10f13 commit d70c247
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/prettify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,20 @@ jobs:
repository: ${{ github.event.pull_request.head.repo.full_name }}
# 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 .
only_changed: True
dry: true
prettier_options: --write
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 "Please run prettier locally"

0 comments on commit d70c247

Please sign in to comment.