name: Validations

on:
  push:
    branches: [ master ]
  pull_request_target:
    branches: [ master ]

env:
  LC_CTYPE: en_US.UTF-8
  LANG: en_US.UTF-8

jobs:
  validate-cocoapods:
    runs-on: macos-12
    steps:
      - uses: maxim-lobanov/setup-xcode@v1.5.1
        with:
          xcode-version: ^14.1
      - uses: actions/checkout@v3
      - run: pod lib lint

  run-danger:
    runs-on: ubuntu-latest
    if: ${{ github.event_name == 'pull_request_target' }}
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: danger/swift
        uses: docker://ghcr.io/danger/danger-swift-with-swiftlint:3.14.2
        with:
          args: --failOnErrors --no-publish-check
        env:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

name: Validations

on:
  push:
    branches: [ master ]
  pull_request_target:
    branches: [ master ]

env:
  LC_CTYPE: en_US.UTF-8
  LANG: en_US.UTF-8

jobs:
  validate-cocoapods:
    runs-on: macos-12
    steps:
      - uses: maxim-lobanov/setup-xcode@v1.5.1
        with:
          xcode-version: ^14.1
      - uses: actions/checkout@v3
      # watchOS is causing problems with the simulator.
      # TODO: Remove platforms parameter and additional linting step
      # once the issue is fixed (by either CocoaPods or Apple)
      - run: pod lib lint --platforms=macos,ios,tvos
      - run: pod lib lint --platforms=watchos
        continue-on-error: true

  run-danger:
    runs-on: ubuntu-latest
    if: ${{ github.event_name == 'pull_request_target' }}
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: danger/swift
        uses: docker://ghcr.io/danger/danger-swift-with-swiftlint:3.14.2
        with:
          args: --failOnErrors --no-publish-check
        env:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

Adjust linting to fix (temporary) error with watchOS
Adjust linting to fix (temporary) error with watchOS
