Skip to content

Python and Rust changes in one PR. #23

Python and Rust changes in one PR.

Python and Rust changes in one PR. #23

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