Skip to content

Merge pull request #76 from 417-72KI/swiftlint-plugin #38

Merge pull request #76 from 417-72KI/swiftlint-plugin

Merge pull request #76 from 417-72KI/swiftlint-plugin #38

Workflow file for this run

name: Package
on:
push:
branches: main
paths:
- Package.swift
- .github/workflows/package.yml
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
resolve-package:
name: Resolve package
runs-on: macos-14
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
- name: Set token to env
run: echo GH_TOKEN=${{ steps.app-token.outputs.token }} >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
token: ${{ env.GH_TOKEN }}
- uses: actions/cache@v4
with:
path: .build
key: ${{ runner.os }}-swift-${{ hashFiles('Package.resolved') }}
restore-keys: |
${{ runner.os }}-swift
${{ runner.os }}-
- name: Update User Defaults
run: |
defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1
defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES
defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES
- name: Resolve dependencies
id: resolve
run: |
swift package resolve
echo "count=$(git diff --name-only | grep -E '^Package.resolved$' | wc -l)" >> $GITHUB_OUTPUT
- name: Commit Package.resolved
if: steps.resolve.outputs.count > 0
run: |
git config user.name github-actions
git config user.email [email protected]
git commit -m "Update Package.resolved" Package.resolved
git push -f
- name: Create Pull Request if failed
if: ${{ steps.resolve.outputs.count > 0 && failure() }}
env:
GH_TOKEN: ${{ env.GH_TOKEN }}
run: |
git checkout -b 'auto/update-package-resolved'
git push -fu origin 'auto/update-package-resolved'
gh pr create -t 'Update Package.resolved' -b ''