Skip to content

Commit

Permalink
ci: update all dependencies for all go mod with dependabot (#13180)
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt authored Sep 14, 2022
1 parent 5deb137 commit 9dacaa4
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 26 deletions.
54 changes: 31 additions & 23 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,99 +7,107 @@ updates:
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10

- package-ecosystem: npm
directory: "/docs"
schedule:
interval: daily
open-pull-requests-limit: 10

- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 20
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/db"
directory: "/simapp"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/api"
directory: "/tests"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/db"
schedule:
interval: weekly
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/api"
schedule:
interval: weekly
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/orm"
schedule:
interval: daily
open-pull-requests-limit: 10
interval: weekly
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/core"
schedule:
interval: daily
open-pull-requests-limit: 10
interval: weekly
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/cosmovisor"
schedule:
interval: daily
open-pull-requests-limit: 10
interval: weekly
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/depinject"
schedule:
interval: daily
open-pull-requests-limit: 10
interval: weekly
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/errors"
schedule:
interval: daily
open-pull-requests-limit: 10
interval: weekly
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/math"
schedule:
interval: daily
open-pull-requests-limit: 10
interval: weekly
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/client/v2"
schedule:
interval: daily
open-pull-requests-limit: 10
interval: weekly
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/store/tools/ics23"
schedule:
interval: daily
open-pull-requests-limit: 10
interval: weekly
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/tx"
schedule:
interval: weekly
labels:
- "A:automerge"
- dependencies
37 changes: 37 additions & 0 deletions .github/workflows/dependabot-update-all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Dependabot Update All Go Modules
on: pull_request

permissions:
pull-requests: write

jobs:
update-all:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
# Secret to be added in the repo under Settings > Secrets > Dependabot
token: ${{ secrets.PRBOT_PAT }}
- uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Extract updated dependency
id: deps
run: |
# Extract the dependency name from the PR title
# Example: "build(deps): Bump github.com/cosmos/cosmos-sdk from 0.46.0 to 0.47.0"
# Extracts "github.com/cosmos/cosmos-sdk" and "0.47.0"
echo "::set-output name=name::$(echo "${{ github.event.pull_request.title }}" | cut -d ' ' -f 3)"
echo "::set-output name=version::$(echo "${{ github.event.pull_request.title }}" | cut -d ' ' -f 7)"
- name: Update all Go modules
run: |
./scripts/go-update-dep-all.sh ${{ format('{0}@v{1}', steps.deps.outputs.name, steps.deps.outputs.version) }}
./scripts/go-mod-tidy-all.sh
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: "${{ github.event.pull_request.title }} for all modules"
6 changes: 3 additions & 3 deletions .github/workflows/fork-cherry-pick.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This CI is disabled on main and meant to be enabled on forks as an easy way to cherry pick fork commits into main.
# In order to submit a PR to main, you must add the PR_BOT_PAT secret (personal access token) for the GitHub Action.
# The PR will be submitted from that user. Note, the PR_BOT_PAT user must have write access to the repo.
# In order to submit a PR from your repo to the Cosmos SDK, a PRBOT_PAT secret (personal access token) must be available for the GitHub Action (Settings > Secrets > Actions).
# The PR will be submitted from the user of the PAT. Note, the PRBOT_PAT user must have write access to the repo.
name: Cherry pick PR to Cosmos SDK
on:
# Set to trigger on every merge to main, not just a closed PR.
Expand Down Expand Up @@ -34,6 +34,6 @@ jobs:
- name: Autocreate PR
shell: bash
env:
GH_TOKEN: ${{ secrets.PR_BOT_PAT }}
GH_TOKEN: ${{ secrets.PRBOT_PAT }}
run: |
gh pr create --repo cosmos/cosmos-sdk --base main --head "${{ github.event.repository.owner.login }}:pr-patch-${{ github.sha }}" --title "${{ github.event.pull_request.title }}" --body "Automated PR for commit: ${{ github.sha }} from ${{ github.repository }}"

0 comments on commit 9dacaa4

Please sign in to comment.