Skip to content

Commit 907a855

Browse files
committed
Copying configuration of linter from upstream
1 parent 1bb6fea commit 907a855

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

.github/workflows/linter.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,34 @@ name: Lint
1212
on:
1313
# push: # Can specify more circumstances under which to run the linter.
1414
# branches: # Not specifying input to "branches:" causes the action to run on push for all branches.
15-
15+
push:
16+
branches:
17+
- master
1618
# Trigger the workflow on pull request,
1719
# but only for master
18-
pull_request:
20+
pull_request_target:
1921
branches:
2022
- master
2123

24+
permissions:
25+
checks: write
26+
contents: read
27+
2228
jobs:
2329
run-linters:
2430
name: Run linters
2531
runs-on: ubuntu-latest
2632

2733
steps:
28-
- name: Check out Git repository
29-
uses: actions/checkout@v2
34+
- name: Check out repository (push)
35+
if: ${{ github.event_name == 'push' }}
36+
uses: actions/checkout@v3
37+
38+
- name: Check out repository (pull_request_target)
39+
if: ${{ github.event_name == 'pull_request_target' }}
40+
uses: actions/checkout@v3
41+
with:
42+
ref: ${{ github.event.pull_request.head.sha }}
3043

3144
- name: Install ClangFormat
3245
run: sudo apt-get install -y clang-format
@@ -39,7 +52,7 @@ jobs:
3952
clang_format_auto_fix: false
4053
auto_fix: false
4154
commit: false
42-
continue_on_error: true
55+
continue_on_error: false
4356
git_email: github.event.commits[0].author.name # Uses the author's git email instead of the default git email associated with the action ("lint-action@samuelmeuli.com")
4457
clang_format_args: -style=file # Any additional arguments for clang_format
4558

0 commit comments

Comments
 (0)