Bump upstream from b8c8d55 to dd2494d
#349
Workflow file for this run
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: Auto-merge Dependabot submodule PRs (with rebase) | |
| on: | |
| pull_request: | |
| types: [opened, reopened, synchronize, ready_for_review] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| concurrency: | |
| group: automerge-${{ github.event.pull_request.number }} | |
| cancel-in-progress: false | |
| jobs: | |
| check-dependabot: | |
| timeout-minutes: 5 | |
| if: > | |
| github.event.pull_request.user.login == 'dependabot[bot]' && | |
| github.event.pull_request.base.ref == 'main' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_process: ${{ steps.check.outputs.should_process }} | |
| steps: | |
| - uses: actions/create-github-app-token@v2 | |
| id: generate-token | |
| with: | |
| app-id: ${{ secrets.GH_APP_ID }} | |
| private-key: ${{ secrets.GH_APP_PRIVATE_KEY }} | |
| owner: ${{ github.repository_owner }} | |
| repositories: ${{ github.event.repository.name }} | |
| - name: Fetch Dependabot metadata | |
| id: meta | |
| uses: dependabot/fetch-metadata@v2 | |
| with: | |
| # Using the App Token generated above | |
| github-token: ${{ steps.generate-token.outputs.token }} | |
| - name: Check if upstream submodule | |
| id: check | |
| run: | | |
| if [[ "${{ steps.meta.outputs.package-ecosystem }}" == "submodules" ]] || \ | |
| [[ "${{ steps.meta.outputs.package-ecosystem }}" == "github_actions" ]]; then | |
| echo "should_process=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "should_process=false" >> $GITHUB_OUTPUT | |
| fi | |
| # Generate docs after dependabot updates the submodule | |
| generate-docs: | |
| needs: check-dependabot | |
| if: needs.check-dependabot.outputs.should_process == 'true' | |
| uses: ./.github/workflows/pull-from-bazel-build.yml | |
| secrets: inherit | |
| with: | |
| is_internal_pr: true | |
| approve-and-merge: | |
| needs: [check-dependabot, generate-docs] | |
| if: needs.check-dependabot.outputs.should_process == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/create-github-app-token@v2 | |
| id: generate-token | |
| with: | |
| app-id: ${{ secrets.GH_APP_ID }} | |
| private-key: ${{ secrets.GH_APP_PRIVATE_KEY }} | |
| owner: ${{ github.repository_owner }} | |
| repositories: ${{ github.event.repository.name }} | |
| - name: Approve pull request | |
| run: gh pr review --approve "${{ github.event.pull_request.html_url }}" | |
| env: | |
| GH_TOKEN: ${{ steps.generate-token.outputs.token }} | |
| - name: Enable auto-merge (squash) | |
| run: gh pr merge --auto --squash "${{ github.event.pull_request.html_url }}" | |
| env: | |
| GH_TOKEN: ${{ steps.generate-token.outputs.token }} |