Skip to content

Commit 8994dc8

Browse files
addressing zizmor findings
Signed-off-by: Barabanov <[email protected]>
1 parent 83e2c06 commit 8994dc8

File tree

6 files changed

+70
-40
lines changed

6 files changed

+70
-40
lines changed

.github/workflows/docs.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Build Docs
2-
permissions: read-all
2+
permissions: { } # No permissions by default on workflow level
33

44
on:
55
workflow_dispatch: # run on request (no need for PR)
@@ -14,20 +14,29 @@ jobs:
1414
contents: write
1515
steps:
1616
- name: Checkout repository
17-
uses: actions/checkout@v4
17+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
with:
19+
persist-credentials: false
1820
- name: Set up Python
19-
uses: actions/setup-python@v5
21+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
2022
with:
2123
python-version: "3.10"
2224
- name: Install dependencies
2325
run: pip install 'src/python/.[docs]'
2426
- name: Install and Generate Doxygen
25-
uses: mattnotmitt/[email protected]
27+
uses: mattnotmitt/doxygen-action@b84fe17600245bb5db3d6c247cc274ea98c15a3b # v1.12.0
2628
- name: Build Docs
2729
run: |
2830
cd docs
2931
make html
32+
- name: Branch name
33+
id: branch_name
34+
shell: bash
35+
run: |
36+
echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/}
3037
- name: Create gh-pages branch
38+
env:
39+
SOURCE: ${{steps.branch_name.outputs.SOURCE_NAME}}
3140
run: |
3241
if [[ ${{github.event_name}} == 'workflow_dispatch' ]]; then
3342
echo RELEASE_VERSION="test_build" >> $GITHUB_ENV
@@ -52,7 +61,7 @@ jobs:
5261
git add .nojekyll
5362
git commit -m "Initializing gh-pages branch"
5463
git push origin gh-pages
55-
git checkout ${{steps.branch_name.outputs.SOURCE_NAME}}
64+
git checkout "${SOURCE}"
5665
echo "Created gh-pages branch"
5766
else
5867
echo "Branch gh-pages already exists"
@@ -77,7 +86,7 @@ jobs:
7786
git add index.html
7887
git commit -m "Update documentation" -a || true
7988
- name: Push changes
80-
uses: ad-m/github-push-action@master
89+
uses: ad-m/github-push-action@77c5b412c50b723d2a4fbc6d71fb5723bcd439aa
8190
with:
8291
github_token: ${{ secrets.GITHUB_TOKEN }}
8392
branch: gh-pages

.github/workflows/pr-labeler.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
#####
2+
# This workflow is triggered by pull_request_target event.
3+
# Never checkout the PR and run ANY local code on it.
4+
#####
5+
16
name: "Pull Request Labeler"
2-
permissions: read-all
7+
permissions: {} # No permissions by default on workflow level
38
on:
4-
- pull_request_target
9+
- pull_request_target # zizmor: ignore[dangerous-triggers]
510

611
jobs:
712
labeler:
@@ -10,6 +15,6 @@ jobs:
1015
pull-requests: write
1116
runs-on: ubuntu-latest
1217
steps:
13-
- uses: actions/labeler@v5
18+
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
1419
with:
1520
repo-token: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/pre_commit.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Pre-Commit Checks
2-
permissions: read-all
2+
permissions: { } # No permissions by default on workflow level
33

44
on:
55
push:
@@ -18,13 +18,15 @@ jobs:
1818
runs-on: ubuntu-22.04
1919
steps:
2020
- name: CHECKOUT REPOSITORY
21-
uses: actions/checkout@v4
21+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22+
with:
23+
persist-credentials: false
2224
- name: Set up Python
23-
uses: actions/setup-python@v5
25+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
2426
with:
2527
python-version: "3.10"
2628
- name: Set up Node.js
27-
uses: actions/setup-node@v4
29+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2830
with:
2931
node-version: 22
3032
- name: Install clang-format
@@ -37,9 +39,11 @@ jobs:
3739
runs-on: ubuntu-22.04
3840
steps:
3941
- name: CHECKOUT REPOSITORY
40-
uses: actions/checkout@v4
42+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
43+
with:
44+
persist-credentials: false
4145
- name: Set up Python
42-
uses: actions/setup-python@v5
46+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
4347
with:
4448
python-version: "3.9"
4549
- name: Install dependencies

.github/workflows/publish.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,19 @@ on:
55
release:
66
types: [published]
77

8-
# Declare default permissions as read only.
9-
permissions: read-all
8+
permissions: { } # No permissions by default on workflow level
109

1110
jobs:
1211
build:
1312
name: Build
1413
runs-on: ubuntu-latest
1514
steps:
1615
- name: Checkout
17-
uses: actions/checkout@v4
16+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
with:
18+
persist-credentials: false
1819
- name: Set up Python 3.10
19-
uses: actions/setup-python@v5
20+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
2021
with:
2122
python-version: "3.10"
2223
- name: Install pypa/build
@@ -25,14 +26,14 @@ jobs:
2526
- name: Build sdist
2627
run: |
2728
python -m build --sdist src/python/
28-
- uses: actions/upload-artifact@v4
29+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
2930
with:
3031
name: artifact-sdist
3132
path: src/python/dist/*.tar.gz
3233
- name: Build wheel
3334
run: |
3435
python -m build --wheel src/python/
35-
- uses: actions/upload-artifact@v4
36+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
3637
with:
3738
name: artifact-wheel
3839
path: src/python/dist/*.whl
@@ -43,9 +44,8 @@ jobs:
4344
environment: pypi
4445
runs-on: ubuntu-latest
4546
permissions:
46-
packages: write
47-
contents: write
48-
id-token: write
47+
contents: write # required by svenstaro/upload-release-action
48+
id-token: write # required by trusted publisher
4949
steps:
5050
- name: Download artifacts
5151
uses: actions/download-artifact@v4
@@ -56,13 +56,13 @@ jobs:
5656
# to determine where to publish the package distribution to PyPI or TestPyPI
5757
- name: Check tag
5858
id: check-tag
59-
uses: actions-ecosystem/action-regex-match@v2
59+
uses: actions-ecosystem/action-regex-match@9e6c4fb3d5e898f505be7a1fb6e7b0a278f6665b # v2.0.2
6060
with:
6161
text: ${{ github.ref }}
6262
regex: '^refs/tags/[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)+(\.[0-9]+rc[0-9]+|rc[0-9]+)?$'
6363
- name: Upload package distributions to github
6464
if: ${{ steps.check-tag.outputs.match != '' }}
65-
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2
65+
uses: svenstaro/upload-release-action@ebd922b779f285dafcac6410a0710daee9c12b82 # v2.10.0
6666
with:
6767
repo_token: ${{ secrets.GITHUB_TOKEN }}
6868
file: dist/*

.github/workflows/test_accuracy.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: test_accuracy
2-
permissions: read-all
2+
permissions: { } # No permissions by default on workflow level
33
on:
44
pull_request:
55
merge_group:
@@ -12,8 +12,10 @@ jobs:
1212
test_accuracy:
1313
runs-on: ubuntu-22.04
1414
steps:
15-
- uses: actions/checkout@v3
16-
- uses: actions/setup-python@v4
15+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
with:
17+
persist-credentials: false
18+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
1719
with:
1820
python-version: "3.12"
1921
cache: pip

.github/workflows/test_precommit.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: test_precommit
2-
permissions: read-all
2+
permissions: { } # No permissions by default on workflow level
33
on:
44
pull_request:
55
merge_group:
@@ -13,9 +13,11 @@ jobs:
1313
runs-on: ubuntu-22.04
1414
steps:
1515
- name: CHECKOUT REPOSITORY
16-
uses: actions/checkout@v4
16+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
with:
18+
persist-credentials: false
1719
- name: Set up Python
18-
uses: actions/setup-python@v5
20+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
1921
with:
2022
python-version: 3.9
2123
cache: pip
@@ -40,18 +42,22 @@ jobs:
4042
name: CPP-Code-Quality
4143
runs-on: ubuntu-latest
4244
steps:
43-
- uses: actions/checkout@v3
45+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
46+
with:
47+
persist-credentials: false
4448
- name: cppcheck
45-
uses: chmorgan/cppcheck-action@main
49+
uses: chmorgan/cppcheck-action@88696b3fd4a3ced3df76a2f7dc44b251d8232bcb # v1.4
4650
with:
4751
github_token: ${{ secrets.GITHUB_TOKEN}}
4852
# missingInclude: cppcheck can't find stl, openvino, opencv
4953
other_options: --suppress=missingInclude -Isrc/cpp/models/include -Isrc/cpp/utils/include -Isrc/cpp/pipelines/include --check-config
5054
CPP-Precommit:
5155
runs-on: ubuntu-22.04
5256
steps:
53-
- uses: actions/checkout@v3
54-
- uses: actions/setup-python@v4
57+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
58+
with:
59+
persist-credentials: false
60+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
5561
with:
5662
python-version: "3.10"
5763
cache: pip
@@ -83,8 +89,10 @@ jobs:
8389
CPP-Windows-Precommit:
8490
runs-on: windows-latest
8591
steps:
86-
- uses: actions/checkout@v3
87-
- uses: actions/setup-python@v4
92+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
93+
with:
94+
persist-credentials: false
95+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
8896
with:
8997
python-version: 3.9
9098
cache: pip
@@ -138,8 +146,10 @@ jobs:
138146
run: |
139147
brew install colima docker
140148
colima start
141-
- uses: actions/checkout@v3
142-
- uses: actions/setup-python@v4
149+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
150+
with:
151+
persist-credentials: false
152+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
143153
with:
144154
python-version: ${{ matrix.python-version }}
145155
cache: pip

0 commit comments

Comments
 (0)