Created
April 4, 2023 03:43
-
-
Save paulz/391c09b3479e669f5b619cd4acb24cce to your computer and use it in GitHub Desktop.
Weekly PR to update dependencies
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: dependencies update | |
# Weekly PR to update dependencies: | |
# - Swift Packages | |
# - Github actions | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- experiment/update-dependencies/** | |
schedule: | |
# Saturday Morning | |
- cron: '0 4 * * 6' # https://crontab.guru/#0_4_*_*_6 | |
defaults: | |
run: | |
shell: zsh --login --errexit --pipefail {0} | |
concurrency: | |
group: one-dependencies-update-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
check-dependencies: | |
runs-on: self-hosted | |
timeout-minutes: 20 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Update Ruby Gems | |
run: bundle update | |
- name: Update Swift packages | |
run: | | |
NEW_SPM_CLONE_DIR=$(mktemp -d) | |
rm ./MyApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved | |
./scripts/resolve-swift-package-dependencies.zsh $NEW_SPM_CLONE_DIR | |
rm -rf $NEW_SPM_CLONE_DIR | |
xcrun swift package update --package-path MyPackage1 | |
xcrun swift package update --package-path MyPackage2 | |
- name: Create Pull Request | |
id: create-pr | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
branch: create-pull-request/update-dependencies | |
delete-branch: true | |
token: ${{ secrets.REPO_SCOPED_TOKEN }} | |
title: Update dependencies | |
commit-message: Update dependencies | |
body: | | |
Automated dependencies update | |
https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
Triggered by event: ${{ github.event_name }} | |
Prepared by runner: ${{ runner.name }} | |
Actor: ${{ github.actor }} | |
See: https://github.com/peter-evans/create-pull-request | |
- name: Pull Request Number and URL | |
if: ${{ steps.create-pr.outputs.pull-request-number }} | |
run: | | |
echo "::notice:: Pull Request Number - ${{ steps.create-pr.outputs.pull-request-number }}" | |
echo "::notice:: Pull Request URL - ${{ steps.create-pr.outputs.pull-request-url }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment