diff --git a/.github/workflows/deploy_doxygen_page.yml b/.github/workflows/deploy_doxygen_page.yml index 03c219fe..b4817d64 100644 --- a/.github/workflows/deploy_doxygen_page.yml +++ b/.github/workflows/deploy_doxygen_page.yml @@ -1,7 +1,7 @@ name: Doxygen GitHub Pages Deploy Action on: release: - types: [published] + types: [released] jobs: generate: diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml new file mode 100644 index 00000000..1d2ef02e --- /dev/null +++ b/.github/workflows/linter.yaml @@ -0,0 +1,32 @@ +name: Linter GitHub Action + +on: + push: + branches-ignore: + - 'ga-ignore-**' + - 'gh-pages' + +jobs: + lint_code: + name: Lint with clang-format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install clang-format + run: sudo apt-get install -y clang-format + + - name: Run clang-format + run: | + git ls-files -z "*.cpp" "*.hpp" | while IFS= read -rd '' f; do tail -c1 < "$f" | read -r _ || echo >> "$f"; done + find . -iname '*.hpp' -o -iname '*.cpp' | xargs clang-format -i + + - name: Set up Git and Push changes + env: + github_token: ${{ secrets.GITHUB_TOKEN }} + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git add . + git commit -m "style: apply linter" || true + git push || true