Update dependencies #1029
This file contains hidden or 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 | |
| permissions: | |
| contents: read | |
| on: | |
| schedule: | |
| - cron: '0 2 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| update-dependencies: | |
| if: github.repository == 'KhronosGroup/SPIRV-Tools' | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| name: Update dependencies | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| # Checkout the depot tools they are needed by roll_deps.sh | |
| - name: Checkout depot tools | |
| run: git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git $GITHUB_WORKSPACE/../depot_tools | |
| - name: Update PATH | |
| run: echo "$GITHUB_WORKSPACE/../depot_tools" >> $GITHUB_PATH | |
| - name: Download dependencies | |
| run: python3 utils/git-sync-deps | |
| - name: Setup git user information | |
| run: | | |
| git config user.name "GitHub Actions[bot]" | |
| git config user.email "<>" | |
| git checkout -b roll_deps | |
| - name: Update dependencies | |
| run: | | |
| utils/roll_deps.sh | |
| if [[ `git diff HEAD..origin/main --name-only | wc -l` == 0 ]]; then | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| fi | |
| id: update_dependencies | |
| - name: Push changes and create PR | |
| if: steps.update_dependencies.outputs.changed == 'true' | |
| run: | | |
| git push --force https://x-access-token:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git roll_deps | |
| # Create a PR. If it aready exists, the command fails, so ignore the return code. | |
| gh pr create --head roll_deps --base main -f || true | |
| # Add the 'kokoro:run' label so that the kokoro tests will be run. | |
| gh pr edit roll_deps --add-label 'kokoro:run' | |
| gh pr merge roll_deps --auto --squash | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} |