Merge pull request #28 from lool/syft #5
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: Static analysis of scripts | |
| on: | |
| # run on pull requests to the main branch | |
| pull_request: | |
| branches: [main] | |
| # run on pushes to the main branch | |
| push: | |
| branches: [main] | |
| # only need permission to read repository; implicitely set all other | |
| # permissions to none | |
| permissions: | |
| contents: read | |
| # cancel in progress builds for this workflow triggered by the same ref | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| flake8: | |
| name: Install and run Flake8 on Python scripts | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install flake8 | |
| run: sudo apt update && sudo apt -y install flake8 | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Run Flake8 | |
| run: flake8 scripts/*.py | |
| pylint: | |
| name: Install and run Pylint on Python scripts | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install Pylint | |
| run: sudo apt update && sudo apt -y install pylint | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Run Pylint (error mode) | |
| run: pylint --errors-only scripts/*.py | |
| shellcheck: | |
| name: Install and run ShellCheck on shell scripts | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install ShellCheck | |
| run: sudo apt update && sudo apt -y install shellcheck | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Run ShellCheck | |
| run: shellcheck scripts/*.sh | |