github.com/cosmos/cosmos-sdk@v0.50.10/.github/workflows/dependabot-update-all.yml (about) 1 name: Dependabot Update All Go Modules 2 on: pull_request 3 4 permissions: 5 pull-requests: write 6 7 jobs: 8 update-all: 9 runs-on: ubuntu-latest 10 if: ${{ github.actor == 'dependabot[bot]' }} 11 steps: 12 - uses: actions/checkout@v3 13 with: 14 repository: ${{ github.event.pull_request.head.repo.full_name }} 15 ref: ${{ github.event.pull_request.head.ref }} 16 # Secret to be added in the repo under Settings > Secrets > Dependabot 17 token: ${{ secrets.PRBOT_PAT }} 18 - uses: actions/setup-go@v4 19 with: 20 go-version: "1.21" 21 check-latest: true 22 - name: Extract updated dependency 23 id: deps 24 run: | 25 # Extract the dependency name from the PR title 26 # Example: "build(deps): Bump github.com/cosmos/cosmos-sdk from 0.46.0 to 0.47.0" 27 # Extracts "github.com/cosmos/cosmos-sdk" and "0.47.0" 28 echo "::set-output name=name::$(echo "${{ github.event.pull_request.title }}" | cut -d ' ' -f 3)" 29 echo "::set-output name=version::$(echo "${{ github.event.pull_request.title }}" | cut -d ' ' -f 7)" 30 - name: Update all Go modules 31 run: | 32 ./scripts/go-update-dep-all.sh ${{ format('{0}@v{1}', steps.deps.outputs.name, steps.deps.outputs.version) }} 33 ./scripts/go-mod-tidy-all.sh 34 - name: Commit changes 35 uses: EndBug/add-and-commit@v9 36 with: 37 default_author: github_actions 38 message: "${{ github.event.pull_request.title }} for all modules"