File tree 1 file changed +15
-4
lines changed
1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -11,17 +11,22 @@ concurrency:
11
11
jobs :
12
12
linter :
13
13
runs-on : ubuntu-latest
14
+ env :
15
+ LocalCommit : ${{ github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }}
14
16
15
17
steps :
16
18
- uses : actions/checkout@v4
17
19
with :
18
20
fetch-depth : 0
19
21
ref : ${{ github.head_ref }}
20
22
token : ${{ secrets.LINTER_PAT }}
23
+ if : env.LocalCommit
21
24
22
- - name : Install clang-format
23
- if : inputs.apply_clang_format
24
- run : pip3 install clang-format==14.0.0
25
+ - uses : actions/checkout@v4
26
+ with :
27
+ fetch-depth : 0
28
+ ref : ${{ github.head_ref }}
29
+ if : ${{ !env.LocalCommit }}
25
30
26
31
- run : git fetch origin $GITHUB_BASE_REF
27
32
59
64
git config user.email "<>"
60
65
61
66
- name : Commit changes
62
- if : steps.check-changes.outputs.ChangesFound == 'True'
67
+ if : steps.check-changes.outputs.ChangesFound == 'True' && env.LocalCommit
63
68
run : |
64
69
git commit -am "Automatically applied linter"
65
70
git push
66
71
72
+ - name : Notify that changes are required
73
+ if : ${{ steps.check-changes.outputs.ChangesFound == 'True' && !env.LocalCommit }}
74
+ run : |
75
+ echo "Linter changes are required" >> $GITHUB_STEP_SUMMARY
76
+ exit 1
77
+
You can’t perform that action at this time.
0 commit comments