Sync/libfuse 3.18.2 #3
This file contains hidden or 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: Checkpatch | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| branches: | |
| - master | |
| jobs: | |
| checkpatch: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y perl | |
| - name: Run checkpatch.pl | |
| run: | | |
| if [ -z "${{ github.base_ref }}" ]; then | |
| echo "Not a pull request, skipping checkpatch" | |
| exit 0 | |
| fi | |
| git fetch origin ${{ github.base_ref }} | |
| base_commit=$(git merge-base origin/${{ github.base_ref }} HEAD) | |
| echo "Base commit: $base_commit" | |
| echo "Running checkpatch.pl on all commits in the PR:" | |
| git rev-list --reverse $base_commit..HEAD | while read commit; do | |
| # Skip dependabot commits - we do not have control over it | |
| if git log -1 --format='%ae' $commit | grep -q "dependabot"; then | |
| echo "Skipping dependabot commit: $commit" | |
| continue | |
| fi | |
| subject=$(git log -1 --format=%s $commit) | |
| echo "Checking commit: $commit - $subject" | |
| if ! ./checkpatch.pl --max-line-length=100 --no-tree --ignore MAINTAINERS,SPDX_LICENSE_TAG,COMMIT_MESSAGE,FILE_PATH_CHANGES,EMAIL_SUBJECT,AVOID_EXTERNS,GIT_COMMIT_ID,ENOSYS_SYSCALL,ENOSYS,FROM_SIGN_OFF_MISMATCH,QUOTED_COMMIT_ID,PREFER_ATTRIBUTE_ALWAYS_UNUSED,PREFER_DEFINED_ATTRIBUTE_MACRO -g $commit; then | |
| echo "checkpatch.pl found issues in commit $commit - $subject" | |
| exit 1 | |
| fi | |
| done |