diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 1e7f43964551..4a7aa2e38a4e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -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 diff --git a/.github/workflows/dependabot-update-all.yml b/.github/workflows/dependabot-update-all.yml new file mode 100644 index 000000000000..6487903e3056 --- /dev/null +++ b/.github/workflows/dependabot-update-all.yml @@ -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" diff --git a/.github/workflows/fork-cherry-pick.yml b/.github/workflows/fork-cherry-pick.yml index ff9bb9e2071c..f89b21b18d41 100644 --- a/.github/workflows/fork-cherry-pick.yml +++ b/.github/workflows/fork-cherry-pick.yml @@ -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. @@ -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 }}"