Skip to content

Commit fdc88e2

Browse files
authored
fix the risk of permissions and unpinned dependencies in the workflow
1 parent c01f4f6 commit fdc88e2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/unit-tests.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
name: Unit Tests
1+
name: unit tests
22

33
on:
44
push:
55
branches: [ "**" ]
66
pull_request:
77
branches: [ "**" ]
88

9+
permissions: read-all
10+
911
jobs:
1012
build:
1113

@@ -40,10 +42,10 @@ jobs:
4042
python-version: "3.7"
4143

4244
steps:
43-
- uses: actions/checkout@v3
45+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4446

4547
- name: Set up Python ${{ matrix.python-version }}
46-
uses: actions/setup-python@v3
48+
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
4749
with:
4850
python-version: ${{ matrix.python-version }}
4951

@@ -56,7 +58,7 @@ jobs:
5658
python -m pip install pytest
5759
5860
- name: Cache data
59-
uses: actions/cache@v3
61+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
6062
with:
6163
path: ${{ env.HANLP_HOME }}
6264
key: hanlp-data
@@ -72,7 +74,7 @@ jobs:
7274
runs-on: ubuntu-latest
7375

7476
steps:
75-
- uses: actions/checkout@v3
77+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
7678
- name: Install dependencies
7779
run: |
7880
python -m pip install setuptools wheel twine

0 commit comments

Comments
 (0)