fix: do walk back handling #10288
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Clang-format | |
on: | |
pull_request: | |
paths: | |
- "src/**" | |
merge_group: | |
push: | |
paths: | |
- "src/**" | |
jobs: | |
cancel-runs: | |
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/main' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Git | |
if: ${{ github.ref != 'refs/heads/main' }} | |
run: | | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "GitHub Actions" | |
- name: Actions checkout | |
if: ${{ github.ref != 'refs/heads/main' }} | |
uses: actions/checkout@v3 | |
with: | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
ref: ${{ github.event.pull_request.head.ref }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run clang format lint | |
if: ${{ github.ref != 'refs/heads/main' }} | |
uses: DoozyX/[email protected] | |
with: | |
source: "src" | |
exclude: "src/protobuf" | |
extensions: "cpp,hpp,h" | |
clangFormatVersion: 17 | |
inplace: true | |
- name: Run add and commit | |
if: ${{ github.ref != 'refs/heads/main' }} | |
uses: EndBug/[email protected] | |
with: | |
author_name: GitHub Actions | |
author_email: github-actions[bot]@users.noreply.github.com | |
message: "Code format - (Clang-format)" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |