Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

white space action #1

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/check-whitespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Check trailing white spaces before merge

on:
pull_request:
push:
branches: [ "main" ]
paths:
- .github/workflows/check-whitespace.yaml

jobs:
check-whitespace:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Get Changed Files
id: changed-files
uses: tj-actions/changed-files@v45
with:
files: |
**/application.properties


- name: Check white spaces scripts
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |

tw_lines=""

for file in ${ALL_CHANGED_FILES}
do
lines=$(egrep -rnIH " +$" $file | cut -f-2 -d ":")
if [ ! -z "$lines" ]; then
tw_lines+=$([[ -z "$tw_lines" ]] && echo "$lines" || echo $'\n'"$lines")
fi
done

exit_code=0

# If tw_lines is not empty, change the exit code to 1 to fail the CI.
if [ ! -z "$tw_lines" ]; then
echo -e "\n***** Lines containing trailing whitespace *****\n"
echo -e "${tw_lines[@]}"
echo -e "\nFailed.\n"
exit_code=1
fi

exit $exit_code


4 changes: 3 additions & 1 deletion mta-v6.x/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ quarkus.openapi-generator.notifications.auth.BearerToken.bearer-token=${NOTIFICA
# Possible values: OFF, FATAL, ERROR, WARN, INFO, DEBUG, ALL.
# and see https://quarkus.io/guides/logging for documentation
quarkus.log.category."org.apache.http".level=INFO
quarkus.log.level=INFO
quarkus.log.level=INFO

# HEY
5 changes: 4 additions & 1 deletion mta-v7.x/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ quarkus.openapi-generator.notifications.auth.BearerToken.bearer-token=${NOTIFICA
# Possible values: OFF, FATAL, ERROR, WARN, INFO, DEBUG, ALL.
# and see https://quarkus.io/guides/logging for documentation
quarkus.log.category."org.apache.http".level=INFO
quarkus.log.level=INFO
quarkus.log.level=INFO

# HEY
# HEYY
Loading