Skip to content

testing with only cpp source files modified, shader files not included #131

testing with only cpp source files modified, shader files not included

testing with only cpp source files modified, shader files not included #131

Workflow file for this run

name: Run clang-format Linter
on:
push:
branches:
- main
- dev
- issue-128-cpp-source
pull_request_target:
branches:
- main
- dev
- issue-128-cpp-source
workflow_dispatch:
jobs:
format:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/checkout@v3
with:
# check out HEAD on the branch
ref: ${{ github.head_ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
# make sure the parent commit is grabbed as well, because
# that's what will get formatted (i.e. the most recent commit)
fetch-depth: 2
# format the latest commit
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v28.0.0
with:
files: |
src/Features/*.cpp
src/Features/*.h
- name: List all changed files
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file was changed"
done
- name: Format changed files
if: steps.changed-files.outputs.any_changed == 'true'
uses: DoozyX/clang-format-lint-action@v0.16.2
with:
source: ${{ steps.changed-files.outputs.all_changed_files }}
exclude: "extern include"
extensions: "h,cpp,c,hlsl,hlsli"
clangFormatVersion: 16
inplace: True # commit the changes (if there are any)
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "style: 🎨 apply clang-format changes"
branch: ${{ github.head_ref }}