Skip to content

Bump production-dependencies-f84fad745d cocoapods packages%0A%0A[dep… #273

Bump production-dependencies-f84fad745d cocoapods packages%0A%0A[dep…

Bump production-dependencies-f84fad745d cocoapods packages%0A%0A[dep… #273

# This adds react-native support to dependabot by automatically running pod install after dependabot upgrades an npm/yarn package.
# Dependabot open issue: https://github.com/dependabot/dependabot-core/issues/935#issuecomment-698481919
name: Update Cocoapods Dependencies after Dependabot package upgrade
on:
workflow_dispatch:
push:
branches:
- dependabot/npm_and_yarn/** # OR dependabot/npm_and_yarn/**react-native** to run only for packages that have react-native in the name
pull_request:
branches:
- dependabot/npm_and_yarn/** # OR dependabot/npm_and_yarn/**react-native** to run only for packages that have react-native in the name
jobs:
run:
name: Run pod install
runs-on: macos-latest
timeout-minutes: 15
permissions:
contents: write
steps:
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- uses: actions/checkout@v6
with:
submodules: recursive
ref: ${{ github.head_ref }}
token: ${{ steps.generate-token.outputs.token }}
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: '22'
cache: 'yarn'
- name: Get ruby version from Gemfile.lock
id: get_ruby_version
run: |
ruby_version=$(grep -A 1 'RUBY VERSION' Gemfile.lock | tail -n 1 | tr -d ' ') # ruby2.6.10p210
ruby_version_number=${ruby_version%%p*} # ruby2.6.10
ruby_version_number=${ruby_version_number#ruby} # 2.6.10
echo "ruby_version=$ruby_version_number" >> $GITHUB_OUTPUT
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ${{ steps.get_ruby_version.outputs.ruby_version }}
working-directory: 'ios'
- name: Setup cocoapods
run: |
cd ios
gem install cocoapods
bundle install
- name: Install Packages
run: |
YARN_ENABLE_SCRIPTS=false yarn install --immutable --check-cache
- name: Cache pods
uses: actions/cache@v5
with:
path: ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Install Cocoapods Packages
run: |
pushd ios
pod install --repo-update
popd
git checkout -- .bundle/config
- name: Generate Commit Message
id: generate_commit_message
# eg: ⬆️ Bump Cocoapods Packages for apple-signin-auth-1.4.0
run: |
branch=${GITHUB_REF#refs/heads/}
# add `[dependabot skip]` prefix so Dependabot force pushes any rebases over our changes triggering the action again
commit_message="Bump ${branch//dependabot\/npm_and_yarn\// } cocoapods packages%0A%0A[dependabot skip]"
echo "commit_message=$commit_message" >> $GITHUB_OUTPUT
- uses: stefanzweifel/git-auto-commit-action@v7
with:
branch: ${{ github.head_ref }}
commit_message: ${{ steps.generate_commit_message.outputs.commit_message }}