Merge pull request #830 from FrameworkComputer/lotus.power_test_ina23… #37
Workflow file for this run
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: lint code in pull request | |
on: | |
pull_request: | |
push: | |
jobs: | |
build: | |
name: lint new changes | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: get checkpatch | |
run: | | |
wget "https://raw.githubusercontent.com/torvalds/linux/master/scripts/checkpatch.pl" | |
wget "https://raw.githubusercontent.com/torvalds/linux/master/scripts/spelling.txt" | |
chmod +x checkpatch.pl | |
- name: checkpatch | |
run: | | |
git diff origin/${{ github.base_ref }} | ./checkpatch.pl --mailback --no-tree --ignore MAINTAINERS,FILE_PATH_CHANGES,SPDX_LICENSE_TAG - > checkpatch.txt || true | |
exit=0 | |
if [ -s checkpatch.txt ]; then | |
errors=$(cat checkpatch.txt) | |
errors="${errors//'%'/'%25'}" | |
errors="${errors//$'\n'/'%0A'}" | |
errors="${errors//$'\r'/'%0D'}" | |
echo "::error file=Checkpatch.txt::$errors" | |
exit=1 | |
fi | |
if [ $exit = 1 ]; then | |
exit 1; | |
fi | |
- name: output | |
run: | | |
cat checkpatch.txt |