我正在运行Mac-os-11上的作业。我也在本地集成了SwiftLint,这是很好的。但是,当有人提高pr时,我需要在SwiftLint上运行GitHub操作。我怎么能这么做。下面是用于操作的当前yml文件。
name: Build & Test
on:
# Run tests when PRs are created or updated
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
env:
# Defines the Xcode version
DEVELOPER_DIR: /Applications/Xcode_13.0.app/Contents/Developer
FETCH_DEPTH: 0
RUBY_VERSION: 2.7.1
defaults:
run:
shell: bash
jobs:
test:
name: Build & Test
if: ${{ github.event.pull_request.draft == false }}
runs-on: macos-11
steps:
- name: Checkout Project
uses: actions/checkout@v2.3.4
with:
fetch-depth: ${{ env.FETCH_DEPTH }}
- name: Restore Gem Cache
uses: actions/cache@v2.1.3
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: ${{ runner.os }}-gem-
- name: Restore Pod Cache
uses: actions/cache@v2.1.3
with:
path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: ${{ runner.os }}-pods-
- name: Setup Ruby
uses: ruby/setup-ruby@v1.51.1
with:
bundler-cache: true
ruby-version: ${{ env.RUBY_VERSION }}SwiftLint在本地运行良好,但是当我提出拉请求时,不会出现SwiftLint警告。
发布于 2022-03-22 11:28:35
我使用这一步骤:
- name: Lint
run: |
set -o pipefail
swiftlint lint --strict --quiet | sed -E 's/^(.*):([0-9]+):([0-9]+): (warning|error|[^:]+): (.*)/::\4 title=Lint error,file=\1,line=\2,col=\3::\5\n\1:\2:\3/'它将迅捷的警告和错误解析为GitHub注释,这些注释可以立即在摘要中看到。
https://stackoverflow.com/questions/71570210
复制相似问题