diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index b7937a2..86994d2 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -17,9 +17,6 @@ concurrency: cancel-in-progress: true env: - PY_LINT_CFG: ".flake8" - LINT_REPORT_FILE: "lint-report" - PY_VER: 3.11.8 PR_CHECK_PREFIX: "feat:|fix:|devops:|Merge|Revert|build\\(deps\\)|\\[Snyk\\]|Bump" GH_SEC_REPORT: false TRIVY_SEVERITY: "HIGH,CRITICAL" @@ -39,7 +36,7 @@ jobs: - name: Get the last commit message id: commit_message - run: | + run: |- COMMIT_MESSAGE=$(git show -s --format=%s) echo "message=${COMMIT_MESSAGE}" >> ${GITHUB_OUTPUT} @@ -59,7 +56,12 @@ jobs: highflame-lint-check: permissions: contents: 'read' + id-token: 'write' runs-on: ubuntu-24.04 + env: + PY_VER: 3.12.0 + PY_LINT_CFG: .flake8 + LINT_REPORT_FILE: lint-report steps: - name: Checkout uses: actions/checkout@v4 @@ -72,19 +74,29 @@ jobs: python-version: ${{ env.PY_VER }} cache: 'pip' - - name: Python Lint Check + - name: Lint Check shell: bash run: |- pip install flake8 flake8 . --config=${{ env.PY_LINT_CFG }} --output-file=${{ env.LINT_REPORT_FILE }}.json - + - name: Upload Lint Report + if: ${{ always() }} uses: actions/upload-artifact@v4 with: name: ${{ env.LINT_REPORT_FILE }} path: ${{ env.LINT_REPORT_FILE }}.json retention-days: 1 + - name: Check If File Exists + id: check_lint_report + run: |- + if [[ -f "${{ env.LINT_REPORT_FILE }}.json" ]] ; then + echo "lint_report=true" >> ${GITHUB_OUTPUT} + fi + outputs: + lint_report: ${{ steps.check_lint_report.outputs.lint_report }} + highflame-trivy-scan: permissions: contents: 'read'