-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: workflow will now comment on PRs
- Loading branch information
1 parent
c0bd240
commit b1d31a6
Showing
1 changed file
with
14 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,13 @@ name: Check Prettier syntax | |
|
||
# This action works with pull requests and pushes on the main branch | ||
on: | ||
pull_request: | ||
pull_request_target: | ||
push: | ||
branches: [main] | ||
|
||
permissions: | ||
pull_requests: write | ||
|
||
jobs: | ||
prettier: | ||
name: Prettier Check | ||
|
@@ -20,7 +23,6 @@ jobs: | |
with: | ||
file_pattern: '**' | ||
config_path: ./.prettierrc.yml | ||
fail_on_error: true | ||
|
||
|
||
# This step only runs if prettier finds errors causing the previous step to fail | ||
|
@@ -30,4 +32,13 @@ jobs: | |
shell: bash | ||
run: | | ||
echo "The following files are not formatted:" | ||
echo "${{steps.prettier-run.outputs.prettier_output}}" | ||
echo "${{steps.prettier-run.outputs.prettier_output}}" | ||
- name: Comment on PRs if failed checks. | ||
if: ${{ failure() }} && github.event_name == 'pull_request': | ||
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. |