Skip to content

chore: workflow will now comment on PRs #1

chore: workflow will now comment on PRs

chore: workflow will now comment on PRs #1

Workflow file for this run

name: Check Prettier syntax
# This action works with pull requests and pushes on the main branch
on:
pull_request_target:
push:
branches: [main]
permissions:
pull_requests: write
jobs:
prettier:
name: Prettier Check
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Run Prettier
id: prettier-run
uses: rutajdash/[email protected]
with:
file_pattern: '**'
config_path: ./.prettierrc.yml
# This step only runs if prettier finds errors causing the previous step to fail
# This steps lists the files where errors were found
- name: Prettier Output
if: ${{ failure() }}
shell: bash
run: |
echo "The following files are not formatted:"
echo "${{steps.prettier-run.outputs.prettier_output}}"
- name: Comment on PRs if failed checks.
if: ${{ failure() }} && github.event_name == 'pull_request':

Check failure on line 38 in .github/workflows/prettier-check.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/prettier-check.yml

Invalid workflow file

You have an error in your yaml syntax on line 38
uses: thollander/[email protected]
with:
message: |
The following files have not been formatted with Prettier:
${{steps.prettier-run.outputs.prettier_output}}
Please go back in and reformat them as necessary.