Skip to content

Commit 8485a9e

Browse files
committed
fix: install pyinstaller and flake8 using a hash for security reasons
1 parent ab50236 commit 8485a9e

File tree

7 files changed

+43
-9
lines changed

7 files changed

+43
-9
lines changed

.github/workflows/general.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- testing-type: yamllint
1616
runs-on: ubuntu-slim
1717
steps:
18-
- uses: actions/checkout@v6.0.2
18+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1919
# yamllint disable-line rule:line-length
2020
- uses: schubergphilis/mcvs-general-action@f52c4433add29d8eff9036bf37b5b69a2c4cf28b # v0.5.8
2121
with:

.github/workflows/mcvs-pr-validation.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ jobs:
1515
MCVS-PR-validation-action:
1616
runs-on: ubuntu-slim
1717
steps:
18-
- uses: actions/checkout@v4.2.2
19-
- uses: schubergphilis/mcvs-pr-validation-action@v0.2.0
18+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19+
# yamllint disable-line rule:line-length
20+
- uses: schubergphilis/mcvs-pr-validation-action@b1c337a896fea52b52a93335713a435d5a07ea72 # v0.2.0

.github/workflows/python.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: python
3+
# "on": pull_request
4+
"on": push
5+
permissions:
6+
contents: read
7+
packages: read
8+
jobs:
9+
mcvs-python-action:
10+
runs-on: ubuntu-slim
11+
steps:
12+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
13+
- uses: ./
14+
with:
15+
token: ${{ secrets.GITHUB_TOKEN }}
16+
pyinstaller-binary-name: some-binary

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ jobs:
1919
MCVS-python-action:
2020
runs-on: ubuntu-24.04
2121
steps:
22-
- uses: actions/checkout@v4.2.2
23-
- uses: schubergphilis/mcvs-python-action@v0.2.1
22+
- uses: actions/checkout@some-hash # v4.2.2
23+
- uses: schubergphilis/mcvs-python-action@some-hash # v0.2.1
2424
with:
2525
token: ${{ secrets.GITHUB_TOKEN }}
2626
```

action.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ runs:
1818
# Install the python version that has been defined in the .python-version
1919
# file.
2020
#
21+
# yamllint disable-line rule:line-length
2122
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
2223
with:
2324
cache: pip
2425
#
2526
# Code security scanning.
2627
#
28+
# yamllint disable-line rule:line-length
2729
- uses: anchore/scan-action@e1165082ffb1fe366ebaf02d8526e7c4989ea9d2 # v6.2.0
2830
with:
2931
only-fixed: false
@@ -39,7 +41,7 @@ runs:
3941
requirements_file=requirements.txt
4042
if [ -f ${requirements_file} ]; then
4143
pip install \
42-
-r ${requirements_file}
44+
--requirement ${requirements_file}
4345
fi
4446
#
4547
# Run pytest if 'import pytest' is found.
@@ -61,7 +63,11 @@ runs:
6163
- name: Code linting with Flake8
6264
shell: bash
6365
run: |
64-
pip install flake8==7.2.0
66+
python3 -m pip install \
67+
--require-hashes \
68+
--user \
69+
--requirement \
70+
${GITHUB_ACTION_PATH}/configs/pip/flake8/requirements.txt
6571
6672
errors=$(flake8 -v --max-line-length=150 --exclude=client/,.venv/,venv/ --count --statistics --exit-zero .)
6773
echo "Flake8 reported $errors errors/warnings."
@@ -88,10 +94,16 @@ runs:
8894
shell: bash
8995
run: |
9096
pip install pyinstaller==v6.13.0
97+
python3 -m pip install \
98+
--require-hashes \
99+
--user \
100+
--requirement \
101+
${GITHUB_ACTION_PATH}/configs/pip/pyinstaller/requirements.txt
91102
pyinstaller --onefile main.py --name gomod-go-version-updater
92-
- name: Attach a binary to a release
103+
# yamllint disable-line rule:line-length
104+
- uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # 2.9.0
105+
name: Attach a binary to a release
93106
if: ${{ steps.condition_check.outcome == 'success' }}
94-
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # 2.9.0
95107
with:
96108
repo_token: ${{ inputs.token }}
97109
file: dist/${{ inputs.pyinstaller-binary-name }}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
flake8==7.2.0 --hash=sha256:93b92ba5bdb60754a6da14fa3b93a9361fd00a59632ada61fd7b130436c40343
2+
pycodestyle==2.13.0 --hash=sha256:35863c5974a271c7a726ed228a14a4f6daf49df369d8c50cd9a6f58a5e143ba9
3+
pyflakes==3.3.2 --hash=sha256:5039c8339cbb1944045f4ee5466908906180f13cc99cc9949348d10f82a5c32a
4+
mccabe==0.7.0 --hash=sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pyinstaller==v6.13.0 --hash=sha256:bc09795f5954135dd4486c1535650958c8218acb954f43860e4b05fb515a21c0

0 commit comments

Comments
 (0)