Skip to content

Commit

Permalink
Add Danger workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mgacy committed Oct 22, 2024
1 parent 21c22e9 commit 4915413
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/danger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Run Danger
on:
workflow_dispatch:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review

jobs:
build:
if: github.event.pull_request.draft == false
name: Run Danger
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Danger
uses: 417-72KI/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 15 additions & 0 deletions Dangerfile.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Danger

extension String: Error {}

let danger = Danger()

if danger.github.pullRequest.body == nil {
danger.fail("Please add a description to this Pull Request")
}

SwiftLint
.lint(
.all(directory: nil),
configFile: ".swiftlint.yml"
)

0 comments on commit 4915413

Please sign in to comment.