Skip to content

fix(deps): update module go.opentelemetry.io/collector/pdata to v1.46.0 #1755

fix(deps): update module go.opentelemetry.io/collector/pdata to v1.46.0

fix(deps): update module go.opentelemetry.io/collector/pdata to v1.46.0 #1755

name: Clang Format Check
on:
push:
branches: [ 'main' ]
pull_request:
branches: [ 'main' ]
permissions:
contents: read
jobs:
clang-format:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
fetch-depth: 0
persist-credentials: false
- name: Install Clang-Format
run: sudo apt-get install clang-format-19
- name: Check Clang Format
run: |
# Check for modified C/C++ files
files=$(git diff --name-status origin/main...HEAD | awk '$1 != "D" && /\.(c|cpp|h)$/ { print ($3 != "" ? $3 : $2) }' )
if [ -z "$files" ]; then
echo "No C/C++ files modified."
exit 0
fi
# Run clang-format and check for changes
clang-format-19 -i $files
if ! git diff --exit-code $files; then
echo "Error: Some files are not formatted correctly. Please run clang-format on the modified files or use the provided pre-commit hook."
exit 1
fi