Skip to content

Commit

Permalink
Update configuration example in README.md
Browse files Browse the repository at this point in the history
- Add missing `on:`
- Add `if:` to avoid failing with "server error status: 403" on PR from forked repository
- Change names
- Fix indentation
  • Loading branch information
norio-nomura committed Nov 4, 2019
1 parent faf70f3 commit 813de29
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,26 @@ This Action executes [SwiftLint](https://github.com/realm/SwiftLint) and generat
An example workflow(`.github/workflows/swiftlint.yml`) to executing SwiftLint follows:

```yaml
name: CI
name: SwiftLint

on:
pull_request:
paths:
- '.github/workflows/swiftlint.yml'
- '.swiftlint.yml'
- '**/*.swift'

jobs:
build:

SwiftLint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: GitHub Action for SwiftLint
uses: norio-nomura/action-swiftlint@2.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v1
- name: GitHub Action for SwiftLint
# Avoid failing with "server error status: 403" on PR from forked repository
if: github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id
uses: norio-nomura/action-swiftlint@2.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
## Secrets
Expand Down

0 comments on commit 813de29

Please sign in to comment.