Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: run clang-tidy changes on a PR #2501

Closed
wants to merge 7 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/awesome_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,16 @@ jobs:
- name: Lint modified files
shell: bash
run: python3 scripts/file_linter.py
- name: Commit and push changes
- if: github.repository == 'TheAlgorithms/C-Plus-Plus' && github.ref == 'refs/heads/master'
name: Commit, push, and create a PR
run: |
git diff DIRECTORY.md
git commit -am "clang-format and clang-tidy fixes for ${GITHUB_SHA::8}" || true
git push origin HEAD:$GITHUB_REF || true
git checkout -b clang-tidy-${{ github.sha }}
git commit -am "fix: clang-format and clang-tidy fixes for ${GITHUB_SHA::8}" || true
git push origin clang-tidy-${{ github.sha }}:clang-tidy-${{ github.sha }}

if [[ $(git log --branches --not --remotes) ]]; then
gh pr create --base ${GITHUB_REF##*/} --head clang-tidy-${{ github.sha }} --title 'fix: `clang-tidy` fixes' --body 'Fixed formatting using `clang-tidy` and `clang-format` (see the diff. for changes).'
fi
build:
name: Compile checks
runs-on: ${{ matrix.os }}
Expand Down