1name: Update dependencies 2permissions: 3 contents: read 4 5on: 6 schedule: 7 - cron: '0 2 * * *' 8 workflow_dispatch: 9 10jobs: 11 update-dependencies: 12 permissions: 13 contents: write 14 pull-requests: write 15 name: Update dependencies 16 runs-on: ubuntu-latest 17 18 steps: 19 - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 20 21 # Checkout the depot tools they are needed by roll_deps.sh 22 - name: Checkout depot tools 23 run: git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git 24 25 - name: Update PATH 26 run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH 27 28 - name: Download dependencies 29 run: python3 utils/git-sync-deps 30 31 - name: Setup git user information 32 run: | 33 git config user.name "GitHub Actions[bot]" 34 git config user.email "<>" 35 git checkout -b roll_deps 36 37 - name: Update dependencies 38 run: | 39 utils/roll_deps.sh 40 if [[ `git diff HEAD..origin/main --name-only | wc -l` == 0 ]]; then 41 echo "changed=false" >> $GITHUB_OUTPUT 42 else 43 echo "changed=true" >> $GITHUB_OUTPUT 44 fi 45 id: update_dependencies 46 - name: Push changes and create PR 47 if: steps.update_dependencies.outputs.changed == 'true' 48 run: | 49 git push --force --set-upstream origin roll_deps 50 # Create a PR. If it aready exists, the command fails, so ignore the return code. 51 gh pr create --base main -f || true 52 # Add the 'kokoro:run' label so that the kokoro tests will be run. 53 gh pr edit --add-label 'kokoro:run' 54 gh pr merge --auto --squash 55 env: 56 GITHUB_TOKEN: ${{ github.token }} 57