[Github] Make PR formatting job only run with C/C++ changes (#69556)

Currently the PR formatting job only runs clang-format. There isn't a
lot of utility in running it if there aren't any C/C++ changes as there
will be nothing to format. This isn't super noisy currently as the job
doesn't fail if there aren't any C/C++ changes, but it's a bit of a
waste.

In addition, this patch names the code formatting job "Check C++
Formatting" to make it clear that this job only checks C/C++ formatting
rather than Python formatting/other languages.
This commit is contained in:
Aiden Grossman 2023-10-18 22:53:17 -07:00 committed by GitHub
parent 1be3b1ef51
commit 80b2aac2c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,10 +1,19 @@
name: "Check code formatting"
on: pull_request_target
on:
pull_request_target:
paths:
- '**/*.cpp'
- '**/*.c'
- '**/*.h'
- '**/*.inc'
permissions:
pull-requests: write
jobs:
code_formatter:
cpp_code_formatter:
name: "Check C++ Formatting"
runs-on: ubuntu-latest
steps:
- name: Fetch LLVM sources