Skip to content

Commit 2d7d5f5

Browse files
authored
workflows: move linting to pull_request
The use of compnerd/swift-format-linter-action avoids the need for the `pull_request_target` workflow trigger as lint issues are reported via the GitHub workflow events and does not require write access.
1 parent fadba9a commit 2d7d5f5

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

.github/workflows/lint.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
name: lint
22

33
on:
4-
pull_request_target:
4+
pull_request:
5+
branches:
6+
- main
7+
paths:
8+
- '**/*.swift'
59

610
jobs:
711
lint:
812
runs-on: windows-latest
913

1014
steps:
1115
- uses: actions/checkout@v2
12-
with:
13-
ref: ${{ github.event.pull_request.head.sha }}
1416
- uses: seanmiddleditch/gha-setup-vsdevenv@master
1517

1618
- name: Install Swift 5.5-DEVELOPMENT-SNAPSHOT-2021-05-02-a
@@ -37,10 +39,7 @@ jobs:
3739
tag: swift-format-5.5-DEVELOPMENT-SNAPSHOT-2021-05-02-a
3840
fileName: swift-format.exe
3941
out-file-path: C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\
40-
# - uses: wearerequired/[email protected]
41-
# with:
42-
# swift_format_official: true
43-
# github_token: ${{ secrets.GITHUB_TOKEN }}
42+
4443
- uses: compnerd/swift-format-linter-action@main
4544
with:
4645
github-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)