diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml new file mode 100644 index 0000000..3bba911 --- /dev/null +++ b/.github/workflows/clang-format.yml @@ -0,0 +1,21 @@ +name: test-clang-format + +on: + push: + branches: + - '*' + pull_request: + workflow_dispatch: + + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: DoozyX/clang-format-lint-action@v0.17 + with: + source: './src/gamepad ./include/gamepad' + extensions: 'hpp,cpp' + clangFormatVersion: 17 \ No newline at end of file diff --git a/.github/workflows/pr-comment.yml b/.github/workflows/pr-comment.yml index f579cdd..f4d610b 100644 --- a/.github/workflows/pr-comment.yml +++ b/.github/workflows/pr-comment.yml @@ -26,7 +26,7 @@ jobs: const old_marker = new RegExp(marker.replace("\r\n", "\r?\n")).exec(old_body)?.[0] ?? marker; - body = old_body.split(old_marker)[0] + marker + body; + body = (old_body ?? "").split(old_marker)[0] + marker + body; await github.request('PATCH /repos/{owner}/{repo}/pulls/{pull_number}', { owner: owner, repo: repo,