File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -21,17 +21,26 @@ jobs:
21
21
!contains(github.event.pull_request.labels.*.name, 'ci/skip') &&
22
22
!contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/')
23
23
steps :
24
+ # Run only in this repository
24
25
- name : Get GitHub App token
25
26
id : get_token
27
+ if : github.event.pull_request.head.repo.full_name == github.repository
26
28
uses : tibdex/github-app-token@v1
27
29
with :
28
30
app_id : ${{ secrets.PIPELINE_GITHUB_APP_ID }}
29
31
private_key : ${{ secrets.PIPELINE_GITHUB_APP_PRIVATE_KEY }}
30
32
- uses : actions/checkout@v2
33
+ if : github.event.pull_request.head.repo.full_name == github.repository
31
34
with :
32
35
fetch-depth : 0
33
36
ref : ${{ github.event.pull_request.head.sha }}
34
37
token : ${{ steps.get_token.outputs.token }}
38
+ # Fetch a fork of the repo
39
+ - uses : actions/checkout@v2
40
+ if : github.event.pull_request.head.repo.full_name != github.repository
41
+ with :
42
+ fetch-depth : 0
43
+ ref : ${{ github.event.pull_request.head.sha }}
35
44
- name : Install pre-commit
36
45
run : python -m pip install pre-commit
37
46
- name : set PY
46
55
run : |
47
56
pre-commit run --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }} --show-diff-on-failure --color=always
48
57
- name : Commit changes
49
- if : ${{ failure() }}
58
+ if : github.event.pull_request.head.repo.full_name == github.repository && failure()
50
59
run : |-
51
60
git add -A
52
61
git config user.name "${GIT_AUTHOR_NAME}"
You can’t perform that action at this time.
0 commit comments