Update Dependencies #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Dependencies | |
on: | |
schedule: | |
- cron: '0 0 */2 * *' | |
workflow_dispatch: | |
jobs: | |
update-dependencies: | |
runs-on: macos-latest | |
steps: | |
- name: Select Xcode | |
run: sudo xcode-select -switch /Applications/Xcode_16.app/Contents/Developer | |
- name: Delete DerivedData directory | |
run: rm -rf ~/Library/Developer/Xcode/DerivedData | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
xcodebuild -resolvePackageDependencies | |
- name: Check for changes | |
id: check_changes | |
run: | | |
git diff --exit-code || echo "::set-output name=changes::true" | |
- name: Commit and push changes | |
if: steps.check_changes.outputs.changes == 'true' | |
run: | | |
git config --local user.email "actions@github.com" | |
git config --local user.name "GitHub Actions" | |
git checkout -b auto-update-dependencies | |
git add . | |
git commit -m "(chore/ci): Auto-update dependencies" | |
git push origin auto-update-dependencies | |
- name: Create Pull Request | |
if: steps.check_changes.outputs.changes == 'true' | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "Auto-update dependencies" | |
branch: auto-update-dependencies |