Python and Rust changes in one PR. #23
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
on: | |
pull_request: | |
paths: | |
- '**/*.py' | |
jobs: | |
check_python: | |
name: Check python files for problems. | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Fake a lint/compile check. | |
run: | | |
pr=$(echo $GITHUB_REF_NAME | grep -o "^[0-9][0-9]*") | |
file_names=$(curl -L -s \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://api.github.com/repos/jsimpson-gro/workflows/pulls/${pr}/files \ | |
| jq -r '.[].filename' | grep "\.py$") | |
echo "Found these matching files: " ${file_names} | |
for file_name in $(echo ${file_names}) ; do | |
echo "Checking file: ${file_name}" | |
if grep "FAIL" ${file_name} >& /dev/null ; then | |
echo " Failed." | |
exit 1 | |
fi | |
done |