Skip to content

Commit 7e66bb0

Browse files
authored
Merge pull request #244 from highflame-ai/devops-check
devops: updating lint checks
2 parents 6f16ef6 + dcd0f1c commit 7e66bb0

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

.github/workflows/pr-check.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ concurrency:
1717
cancel-in-progress: true
1818

1919
env:
20-
PY_LINT_CFG: ".flake8"
21-
LINT_REPORT_FILE: "lint-report"
22-
PY_VER: 3.11.8
2320
PR_CHECK_PREFIX: "feat:|fix:|devops:|Merge|Revert|build\\(deps\\)|\\[Snyk\\]|Bump"
2421
GH_SEC_REPORT: false
2522
TRIVY_SEVERITY: "HIGH,CRITICAL"
@@ -39,7 +36,7 @@ jobs:
3936

4037
- name: Get the last commit message
4138
id: commit_message
42-
run: |
39+
run: |-
4340
COMMIT_MESSAGE=$(git show -s --format=%s)
4441
echo "message=${COMMIT_MESSAGE}" >> ${GITHUB_OUTPUT}
4542
@@ -59,7 +56,12 @@ jobs:
5956
highflame-lint-check:
6057
permissions:
6158
contents: 'read'
59+
id-token: 'write'
6260
runs-on: ubuntu-24.04
61+
env:
62+
PY_VER: 3.12.0
63+
PY_LINT_CFG: .flake8
64+
LINT_REPORT_FILE: lint-report
6365
steps:
6466
- name: Checkout
6567
uses: actions/checkout@v4
@@ -72,19 +74,29 @@ jobs:
7274
python-version: ${{ env.PY_VER }}
7375
cache: 'pip'
7476

75-
- name: Python Lint Check
77+
- name: Lint Check
7678
shell: bash
7779
run: |-
7880
pip install flake8
7981
flake8 . --config=${{ env.PY_LINT_CFG }} --output-file=${{ env.LINT_REPORT_FILE }}.json
80-
82+
8183
- name: Upload Lint Report
84+
if: ${{ always() }}
8285
uses: actions/upload-artifact@v4
8386
with:
8487
name: ${{ env.LINT_REPORT_FILE }}
8588
path: ${{ env.LINT_REPORT_FILE }}.json
8689
retention-days: 1
8790

91+
- name: Check If File Exists
92+
id: check_lint_report
93+
run: |-
94+
if [[ -f "${{ env.LINT_REPORT_FILE }}.json" ]] ; then
95+
echo "lint_report=true" >> ${GITHUB_OUTPUT}
96+
fi
97+
outputs:
98+
lint_report: ${{ steps.check_lint_report.outputs.lint_report }}
99+
88100
highflame-trivy-scan:
89101
permissions:
90102
contents: 'read'

0 commit comments

Comments
 (0)