Skip to content

Commit c79e042

Browse files
committed
fix: pin dependencies and add PR context validation
- Pin dependency versions for reproducibility - Add PR context validation to workflows - Map mobile/plugin to admin for disable check
1 parent 32a093b commit c79e042

3 files changed

Lines changed: 27 additions & 6 deletions

File tree

.github/workflows/python-checks.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,14 @@ jobs:
113113
with:
114114
fetch-depth: 0
115115

116+
- name: Validate PR context
117+
run: |
118+
if [ -z "${{ github.event.pull_request.base.sha }}" ]; then
119+
echo "Error: This check must be called from a pull_request event context"
120+
echo "It requires pull_request.base.sha and pull_request.head.sha to determine changed files"
121+
exit 1
122+
fi
123+
116124
- name: Get changed files
117125
id: changed-files
118126
run: |
@@ -136,4 +144,9 @@ jobs:
136144
137145
- name: Run disable statements check
138146
run: |
139-
python /tmp/scripts/disable_statements_check.py --repo=${{ inputs.repo-type }} --files ${{ steps.changed-files.outputs.all_changed_files }}
147+
# Map repo types to script-compatible values (script only accepts 'api' or 'admin')
148+
REPO_TYPE="${{ inputs.repo-type }}"
149+
if [[ "$REPO_TYPE" == "mobile" || "$REPO_TYPE" == "plugin" ]]; then
150+
REPO_TYPE="admin"
151+
fi
152+
python /tmp/scripts/disable_statements_check.py --repo=$REPO_TYPE --files ${{ steps.changed-files.outputs.all_changed_files }}

.github/workflows/python-disable-check.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ jobs:
1818
with:
1919
fetch-depth: 0
2020

21+
- name: Validate PR context
22+
run: |
23+
if [ -z "${{ github.event.pull_request.base.sha }}" ]; then
24+
echo "Error: This workflow must be called from a pull_request event context"
25+
echo "It requires pull_request.base.sha and pull_request.head.sha to determine changed files"
26+
exit 1
27+
fi
28+
2129
- name: Get changed files
2230
id: changed-files
2331
run: |

.github/workflows/requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
##############################################################################
1313

1414
# Code Formatting
15-
black
15+
black==25.1.0
1616

1717
# Docstring Checking
18-
pydocstyle
19-
docstring_parser
18+
pydocstyle==6.3.0
19+
docstring_parser==0.17.0
2020

2121
# Linting
22-
flake8
23-
flake8-docstrings
22+
flake8==7.3.0
23+
flake8-docstrings==1.7.0

0 commit comments

Comments
 (0)