From 7126201b600bb9a8e1360ff19ff351b8013b2d16 Mon Sep 17 00:00:00 2001 From: Adriano dos Santos Fernandes Date: Wed, 29 Jun 2022 21:35:02 -0300 Subject: [PATCH] Add workflow to trim trailing spaces from source files. --- .github/workflows/trim-trailing-spaces.yml | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/trim-trailing-spaces.yml diff --git a/.github/workflows/trim-trailing-spaces.yml b/.github/workflows/trim-trailing-spaces.yml new file mode 100644 index 0000000000..23539d1d25 --- /dev/null +++ b/.github/workflows/trim-trailing-spaces.yml @@ -0,0 +1,40 @@ +name: trim-trailing-spaces + +on: + schedule: + - cron: '0 10 * * *' + +jobs: + trim-trailing-spaces: + if: github.repository == 'FirebirdSQL/firebird' + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + branch: + - master + - v4.0-release + + steps: + - uses: actions/checkout@v2 + with: + ref: ${{ matrix.branch }} + persist-credentials: false + fetch-depth: 0 + + - name: Trim trailing spaces + run: | + find src/ -type f \( -iname \*.h -o -iname \*.cpp -o -iname \*.c -o -iname \*.epp -o -iname \*.y \) | xargs sed -i 's/[ \t]*$//' + + - name: Commit files + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git commit -a -m Misc. || exit 0 + + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ matrix.branch }}