Skip to content

Commit

Permalink
ci: rename and enhance dependency update checker
Browse files Browse the repository at this point in the history
  • Loading branch information
yorifuji committed Jun 3, 2024
1 parent 77a6946 commit 0137f4c
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/pubspec-update-checker.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: pubspec.yaml update checker
name: dependency update checker

run-name: Check pubspec.lock updates ${{ (vars.RUNS_ON_SELF_HOSTED == null && '(on GitHub-hosted)') || '(on self-hosted)' }}

Expand All @@ -16,7 +16,7 @@ permissions:
pull-requests: write

jobs:
pubspec-update-checker:
dependency-update-checker:
runs-on: ${{ (vars.RUNS_ON_SELF_HOSTED == null && 'ubuntu-latest') || 'self-hosted' }}
timeout-minutes: 30
steps:
Expand All @@ -31,7 +31,10 @@ jobs:
- name: Check for changes
run: |
rm pubspec.lock
rm ios/Podfile.lock
flutter pub get
pod repo update
pod install --repo-update
git diff
- name: Create PR if changes
Expand All @@ -41,11 +44,11 @@ jobs:
if [[ -n $(git status --porcelain) ]]; then
git config --local user.name $GIT_USER_NAME
git config --local user.email $GIT_USER_EMAIL
git add pubspec.lock
git commit -m "Update pubspec.lock"
git checkout -b ci/pubspec-update-checker
git push -f origin ci/pubspec-update-checker
gh pr create --base ${{ github.ref_name }} --head ci/pubspec-update-checker --title "CI: Update pubspec.lock" --body "Update pubspec.lock" || exit 0
git add pubspec.lock ios/Podfile.lock
git commit -m "Update dependencies"
git checkout -b ci/dependency-update-checker
git push -f origin ci/dependency-update-checker
gh pr create --base ${{ github.ref_name }} --head ci/dependency-update-checker --title "CI: Update dependencies" --body "Update dependencies" || exit 0
else
git push -d origin ci/pubspec-update-checker || exit 0
git push -d origin ci/dependency-update-checker || exit 0
fi

0 comments on commit 0137f4c

Please sign in to comment.