Avoid checking header in __init__.py #47
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: Check Added Files Format | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
check_added_files: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v38 | |
- name: Run the checkFileHeader script on added files | |
run: | | |
# Run the script on each added file | |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do | |
extension="${file##*.}" | |
chmod +x ./applications/scripts/checkFileHeader.sh | |
if [ "$extension" == "py" ]; then | |
if [ "$(basename "$file")" != "__init__.py"]; then | |
echo "Checking: $file" | |
./applications/scripts/checkFileHeader.sh "$file" | |
fi | |
done |