Skip to content

Commit f48e200

Browse files
authored
Merge pull request #87 from GitGuardian/agateau/no-ggshield-on-forks
Avoid lint fail on PR from forks
2 parents 32807ed + bc46666 commit f48e200

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/test-lint.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
name: Main
22

3+
# About steps requiring the GITGUARDIAN_API_KEY:
4+
#
5+
# For security reasons, secrets are not available when a workflow is triggered
6+
# by a pull request from a fork. This causes all steps requiring the
7+
# GITGUARDIAN_API_KEY to fail. To avoid this, we skip those steps when we are
8+
# triggered by a pull request from a fork.
9+
310
on:
411
pull_request:
512
workflow_dispatch:
@@ -38,6 +45,12 @@ jobs:
3845
- name: Install pre-commit hooks
3946
run: pre-commit install --install-hooks
4047

48+
- name: Skip ggshield hooks when running from a fork
49+
# See note about steps requiring the GITGUARDIAN_API at the top of this file
50+
if: ${{ github.event.pull_request.head.repo.fork }}
51+
run: |
52+
echo "SKIP=ggshield" >> $GITHUB_ENV
53+
4154
- name: Run pre-commit checks
4255
run: pre-commit run --show-diff-on-failure --all-files
4356
env:

0 commit comments

Comments
 (0)