Skip to content

removed benign newline from b4a9968 #5

removed benign newline from b4a9968

removed benign newline from b4a9968 #5

Workflow file for this run

name: Run clang-format Linter
on:
push:
branches:
- main
- dev
- issue-128-test
pull_request_target:
branches:
- main
- dev
- issue-128-test
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
**/*.hlsl
**/*.hlsli
- 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 }}