From 97a32e3dca2c7d63727a9e5f93817ef72ba0710a Mon Sep 17 00:00:00 2001 From: xiaoyifang <105986+xiaoyifang@users.noreply.github.com> Date: Thu, 27 Jul 2023 22:45:50 +0800 Subject: [PATCH] fix: clang format action (#1017) * action: format * action: format * action: format * Update auto format.yml * Update .github/workflows/auto format.yml * Update auto format.yml * test * [autofix.ci] apply automated fixes --------- Co-authored-by: shenleban tongying Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- .github/workflows/auto format.yml | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/auto format.yml b/.github/workflows/auto format.yml index 113a57e1..814538d0 100644 --- a/.github/workflows/auto format.yml +++ b/.github/workflows/auto format.yml @@ -15,27 +15,19 @@ on: permissions: contents: read jobs: - format: + clang-format: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3.5.2 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: ubuntu install clang-format - # if: ${{ github.event.pull_request.head.repo.full_name == 'xiaoyifang/goldendict-ng' }} - id: clang-format run: | - sudo apt-get install git lsb-release wget software-properties-common - wget -qO - https://apt.llvm.org/llvm.sh| sudo bash - sudo apt-get update - sudo apt-get install -y clang-format - git-clang-format --style=file HEAD^ + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + brew install clang-format + (/home/linuxbrew/.linuxbrew/opt/clang-format/bin/git-clang-format --binary=/home/linuxbrew/.linuxbrew/opt/clang-format/bin/clang-format --style=file HEAD^) || true - uses: autofix-ci/action@89762f9c25dd85f6b78cd40e521232e403357ec0 @@ -58,4 +50,4 @@ jobs: # run: | # shopt -s globstar # pngquant -f --ext .png --skip-if-larger -- **/*.png - - uses: autofix-ci/action@89762f9c25dd85f6b78cd40e521232e403357ec0 \ No newline at end of file + - uses: autofix-ci/action@89762f9c25dd85f6b78cd40e521232e403357ec0