Skip to content

Update SwiftProtobuf plugins and regenerate proto files plus use swift 6.2 #265

Update SwiftProtobuf plugins and regenerate proto files plus use swift 6.2

Update SwiftProtobuf plugins and regenerate proto files plus use swift 6.2 #265

Workflow file for this run

name: Swift Format Check and Fix
on:
pull_request:
branches: [main]
jobs:
format-check:
name: Swift Format Check
runs-on: ubuntu-latest
container: swift:6.1.0
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Run Swift Format Check
id: format_check
run: swift format lint --recursive --strict Sources
continue-on-error: true
- name: Fix Formatting Issues
if: steps.format_check.outcome != 'success'
run: swift format --recursive --in-place Sources
- name: Comment on PR
if: steps.format_check.outcome != 'success'
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `## Swift Format Check Failed
The Swift formatter found issues with your code. Please run the following command to fix them:
\`\`\`
swift format --recursive --in-place Sources
\`\`\`
Then commit and push the changes.`
});