-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
if [ $status == 0]; then | ||
echo "## Formatting Check passed 🥳" >>$GITHUB_STEP_SUMMARY | ||
echo "All files are formatted correctly" >>$GITHUB_STEP_SUMMARY | ||
else | ||
echo "## Formatting Check Failed" >>$GITHUB_STEP_SUMMARY | ||
echo "Please run prettier using \`npx prettier . --write\` in order to format your code" >>$GITHUB_STEP_SUMMARY | ||
echo "### Files with bad formatting:" >>$GITHUB_STEP_SUMMARY | ||
for file in $files; do | ||
echo "- $file" >>$GITHUB_STEP_SUMMARY | ||
done | ||
fi |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Prettier Formatting Check | ||
run-name: Running formatting check | ||
on: [push] | ||
jobs: | ||
check-formatting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Prettier check | ||
run: | | ||
echo files=`npx prettier . --check`>> "$GITHUB_ENV" | ||
echo status=`echo $?`>>"$GITHUB_ENV" | ||
- name: generate github check message | ||
run: .github/workflows/generateCheck.sh |