From ef322de37ade700d3bafd79a42f5aa414347c250 Mon Sep 17 00:00:00 2001 From: Willow Connelly <123427248+wiIliu@users.noreply.github.com> Date: Sat, 14 Mar 2026 19:17:12 -0400 Subject: [PATCH 1/3] Update pylint.yml action --- .github/workflows/pylint.yml | 59 +++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 4ce4fb0..f41f92f 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -4,31 +4,48 @@ on: pull_request: branches: - main + push: + branches: + - dev + jobs: - build: + pylint: + name: pylint runs-on: ubuntu-latest strategy: matrix: python-version: ["3.11"] steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pylint pylint-junit - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Analysing the code with pylint - run: | - pylint $(git ls-files '*.py') --exit-zero \ - --reports=y \ - --output-format=junit-xml:pylint.xml + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: "pip" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - uses: dciborow/action-pylint@0.1.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + glob_pattern: "**/*.py" + pylint_rc: .pylintrc + reporter: github-pr-review + level: warning + + # - name: Generate pylint JUnit report + # run: | + # FILES=$(git ls-files '*.py') + # if [ -n "$FILES" ]; then + # pylint $FILES --output-format=junit-xml:pylint.xml + # fi - - name: upload artifact - uses: actions/upload-artifact@v6 - with: - name: pylint-report - path: pylint.xml + # - name: Upload artifact + # uses: actions/upload-artifact@v6 + # with: + # name: pylint-report + # path: pylint.xml From 46d25ca96416ee3459eaeddf47887607ba34dbb4 Mon Sep 17 00:00:00 2001 From: Willow Connelly <123427248+wiIliu@users.noreply.github.com> Date: Sat, 14 Mar 2026 19:21:38 -0400 Subject: [PATCH 2/3] Update tests.yml --- .github/workflows/tests.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c78b55f..199ba13 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,13 +1,10 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python - -name: tests +name: Tests on: push: branches: [ "main", "dev" ] pull_request: - branches: [ "main", "dev", "tests/tests-new-enpoints-and-crud" ] + branches: [ "main", "dev" ] permissions: contents: read @@ -42,11 +39,12 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.11" + cache: "pip" - name: Install dependencies run: | python -m pip install --upgrade pip - pip install pytest pytest-cov alembic + pip install pytest-cov if [ -f orders_service/requirements-dev.txt ]; then pip install -r orders_service/requirements-dev.txt; fi - name: Wait for Postgres @@ -60,7 +58,7 @@ jobs: # env: # DATABASE_URL: postgresql://test:test@localhost:5432/test_db - - name: Integration tests with pytest + - name: Tests with pytest run: | mkdir -p logs LOGFILE="logs/pytest-$(date +'%Y-%m-%d_%H%M%S').log" From 90247aac9ecf0d2b3ca56703b1a8c766b105b459 Mon Sep 17 00:00:00 2001 From: Willow Connelly <123427248+wiIliu@users.noreply.github.com> Date: Sat, 14 Mar 2026 19:22:11 -0400 Subject: [PATCH 3/3] Potential fix for code scanning alert no. 3: Workflow does not contain permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- .github/workflows/pylint.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index f41f92f..1cf0020 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -12,6 +12,9 @@ jobs: pylint: name: pylint runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write strategy: matrix: python-version: ["3.11"]