Skip to content

Commit ac2f8a2

Browse files
authored
Fix typo-check in CI, run only for pull requests because of security reasons (#4433)
1 parent 88bcdc9 commit ac2f8a2

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

.github/workflows/bk-ci.yml

+14-3
Original file line numberDiff line numberDiff line change
@@ -485,11 +485,14 @@ jobs:
485485

486486
typo-check:
487487
name: Typo Check
488+
# only run on pull requests because of security reasons
489+
# we shouldn't trust external actions for builds within the repository
490+
if: ${{ github.event_name == 'pull_request' }}
488491
runs-on: ubuntu-latest
489492
steps:
490493
- uses: actions/checkout@v4
491494
- name: Check typos
492-
uses: crate-ci/typos@master
495+
uses: crate-ci/typos@v1.22.4
493496

494497
owasp-dependency-check:
495498
name: OWASP Dependency Check
@@ -551,11 +554,19 @@ jobs:
551554
'windows-build'
552555
]
553556
steps:
554-
- name: Check build-and-license-check and typo-check success
557+
- name: Check build-and-license-check success
555558
run: |
556559
if [[ ! ( \
557560
"${{ needs.build-and-license-check.result }}" == "success" \
558-
&& "${{ needs.typo-check.result }}" == "success" \
561+
) ]]; then
562+
echo "Required jobs haven't been completed successfully."
563+
exit 1
564+
fi
565+
- name: Check typo-check success for pull requests
566+
if: ${{ github.event_name == 'pull_request' }}
567+
run: |
568+
if [[ ! ( \
569+
"${{ needs.typo-check.result }}" == "success" \
559570
) ]]; then
560571
echo "Required jobs haven't been completed successfully."
561572
exit 1

0 commit comments

Comments
 (0)