1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00
irssi/.github/workflows/clangformat.yml

27 lines
950 B
YAML
Raw Normal View History

on: [pull_request]
name: clang-format
jobs:
check-clang-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: fetch target ref
run:
|
refs=($(git log -1 --format=%s))
git fetch --depth=1 origin "${refs[3]}"
2020-04-28 09:34:47 -04:00
- name: configure clang-format
run:
|
git config clangformat.binary $PWD/.github/workflows/clangformat/clang-format-xs
git config clangformat.extensions c,h,xs
- name: run git-clang-format and Check if no changes are needed
run:
|
git-clang-format-9 --diff FETCH_HEAD HEAD | tee git-clang-format.diff
2020-04-14 03:47:41 -04:00
cmp -s <(echo no modified files to format) git-clang-format.diff || cmp -s <(echo -n) git-clang-format.diff
- uses: actions/upload-artifact@v1
if: failure()
with:
name: git-clang-format.diff
path: git-clang-format.diff