Skip to content

Commit e5ec96c

Browse files
authored
Update workflows to address code scan warnings (#149)
1 parent e55454e commit e5ec96c

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,17 @@ concurrency:
3030
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
3131
cancel-in-progress: true
3232

33+
# Declare default workflow permissions as read only.
34+
permissions: read-all
35+
3336
jobs:
3437
clang-format-check:
3538
name: Clang code formatting
3639
runs-on: ubuntu-latest
3740

3841
steps:
3942
- name: Checkout repository
40-
uses: actions/checkout@v5
43+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
4144

4245
- name: Install clang-format
4346
run: |
@@ -59,10 +62,10 @@ jobs:
5962

6063
steps:
6164
- name: Checkout repository
62-
uses: actions/checkout@v5
65+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
6366

6467
- name: Set up Bazel
65-
uses: bazel-contrib/setup-bazel@0.14.0
68+
uses: bazel-contrib/setup-bazel@e8776f58fb6a6e9055cbaf1b38c52ccc5247e9c4 # 0.14.0
6669
with:
6770
bazelisk-cache: true
6871
disk-cache: ${{ github.workflow }}

.github/workflows/prerelease.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
mkdir version
3636
echo "$(python _version.py).dev$(date '+%Y%m%d%H%M%S')" > version/version.txt
3737
cat version/version.txt
38-
- uses: actions/upload-artifact@master
38+
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
3939
with:
4040
name: version-file
4141
path: version
@@ -55,13 +55,13 @@ jobs:
5555
with:
5656
python-version: ${{ matrix.python-version }}
5757

58-
- uses: actions/download-artifact@master
58+
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
5959
with:
6060
name: version-file
6161
path: version
6262

6363
- name: Set up Bazel
64-
uses: bazel-contrib/setup-bazel@0.14.0
64+
uses: bazel-contrib/setup-bazel@e8776f58fb6a6e9055cbaf1b38c52ccc5247e9c4 # 0.14.0
6565
with:
6666
bazelisk-cache: true
6767
disk-cache: ${{ github.workflow }}
@@ -72,7 +72,7 @@ jobs:
7272
TARGET_PYTHON: ${{ matrix.python-version }}
7373
run: |
7474
echo "set version to ${TARGET_PYTHON}"
75-
python _update_bazel_py_version.py $TARGET_PYTHON
75+
python _update_bazel_py_version.py $TARGET_PYTHON
7676
7777
- name: Build package
7878
env:
@@ -84,7 +84,7 @@ jobs:
8484
sed "s/^MANYLINUX_VERSION.*/MANYLINUX_VERSION=\"manylinux_${GLIBC_VERSION}_x86_64.manylinux2014_x86_64\"/" BUILD -i || true
8585
bazel build --define GLIBC_VERSION=$GLIBC_VERSION --define TARGET_VERSION="$(python -c "print(\"py${TARGET_PYTHON}\".replace(\".\", \"\"))")" --define VERSION="$(cat version/version.txt)" :tesseract_decoder_wheel
8686
87-
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v4
87+
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
8888
with:
8989
name: python-wheels-${{ matrix.os }}-${{ matrix.python-version }}
9090
path: ./bazel-bin/*.whl
@@ -96,7 +96,7 @@ jobs:
9696

9797
steps:
9898
- name: Download build artifacts
99-
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
99+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
100100
with:
101101
pattern: python-wheels-*
102102
merge-multiple: true

.github/workflows/stable-release-workflow.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
mkdir version
3535
echo "$(python _version.py)" > version/version.txt
3636
cat version/version.txt
37-
- uses: actions/upload-artifact@master
37+
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
3838
with:
3939
name: version-file
4040
path: version
@@ -55,13 +55,13 @@ jobs:
5555
with:
5656
python-version: ${{ matrix.python-version }}
5757

58-
- uses: actions/download-artifact@master
58+
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
5959
with:
6060
name: version-file
6161
path: version
6262

6363
- name: Set up Bazel
64-
uses: bazel-contrib/setup-bazel@0.14.0
64+
uses: bazel-contrib/setup-bazel@e8776f58fb6a6e9055cbaf1b38c52ccc5247e9c4 # 0.14.0
6565
with:
6666
bazelisk-cache: true
6767
disk-cache: ${{ github.workflow }}
@@ -72,7 +72,7 @@ jobs:
7272
TARGET_PYTHON: ${{ matrix.python-version }}
7373
run: |
7474
echo "set version to ${TARGET_PYTHON}"
75-
python _update_bazel_py_version.py $TARGET_PYTHON
75+
python _update_bazel_py_version.py $TARGET_PYTHON
7676
7777
- name: Build package
7878
env:
@@ -84,7 +84,7 @@ jobs:
8484
sed "s/^MANYLINUX_VERSION.*/MANYLINUX_VERSION=\"manylinux_${GLIBC_VERSION}_x86_64.manylinux2014_x86_64\"/" BUILD -i || true
8585
bazel build --define TARGET_VERSION="$(python -c "print(\"py${TARGET_PYTHON}\".replace(\".\", \"\"))")" --define VERSION="$(cat version/version.txt)" :tesseract_decoder_wheel
8686
87-
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v4
87+
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
8888
with:
8989
name: python-wheels-${{ matrix.os }}-${{ matrix.python-version }}
9090
path: ./bazel-bin/*.whl
@@ -96,7 +96,7 @@ jobs:
9696

9797
steps:
9898
- name: Download build artifacts
99-
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
99+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
100100
with:
101101
pattern: python-wheels-*
102102
merge-multiple: true

0 commit comments

Comments
 (0)