Skip to content

Commit

Permalink
PI-2410 Auto-merge minor+patch Dependabot PRs (#4095)
Browse files Browse the repository at this point in the history
* PI-2410 Auto-merge minor+patch Dependabot PRs

Also reduced frequency, all Dependabot updates will now happen on Monday.

* Update post-build step to check for matrix status

* Fix documentation post-build step
  • Loading branch information
marcus-bcl authored Aug 2, 2024
1 parent 62b978f commit 0b835a8
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 21 deletions.
39 changes: 18 additions & 21 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ updates:
- package-ecosystem: "gradle"
directory: "/"
schedule:
interval: "daily"
ignore:
- dependency-name: "software.amazon.awssdk:*" # reduce the noise of frequent AWS SDK updates
update-types: ["version-update:semver-patch"]
interval: "weekly"
groups:
minor:
update-types:
Expand All @@ -21,7 +18,7 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
groups:
minor:
update-types:
Expand All @@ -33,79 +30,79 @@ updates:
- package-ecosystem: "github-actions"
directory: "/.github/actions/analyse"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/.github/actions/app-insights-to-slack"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/.github/actions/check-changes"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/.github/actions/cloud-platform-auth"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/.github/actions/cloud-platform-deploy"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/.github/actions/create-signed-pull-request"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/.github/actions/docker-build"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/.github/actions/format-code"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/.github/actions/get-build-info"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/.github/actions/get-env-details"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/.github/actions/merge-changes"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/.github/actions/render-project-template"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "terraform"
directory: "/templates"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "docker"
directory: "/projects/person-search-index-from-delius/container"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "docker"
directory: "/projects/redrive-dead-letter-queues/container"
schedule:
interval: "monthly" # to reduce frequency of AWS CLI updates
interval: "weekly"

- package-ecosystem: "docker"
directory: "/projects/feature-flags/container"
schedule:
interval: "daily"
interval: "weekly"
10 changes: 10 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ jobs:
name: Build
uses: ./.github/workflows/build.yml

post-build:
name: Post-build
runs-on: ubuntu-latest
needs: build
if: always()
steps:
- name: Check build matrix status
if: ${{ needs.build.result != 'success' }}
run: exit 1

analyse:
name: Analyse
runs-on: ubuntu-latest
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Automated management of Dependabot PRs
name: Dependabot
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ github.token }}"

- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ github.token }}

- name: Auto-approve minor or patch versions
run: gh pr review --approve "$PR_URL"
if: steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ github.token }}
12 changes: 12 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,18 @@ jobs:
name: ${{ matrix.project }}
path: projects/${{ matrix.project }}/tech-docs/build

post-build:
name: Post-build
runs-on: ubuntu-latest
needs:
- build-index
- build-projects
if: always()
steps:
- name: Check build matrix status
if: ${{ needs.build-index.result != 'success' || needs.build-projects.result != 'success' }}
run: exit 1

deploy:
runs-on: ubuntu-latest
timeout-minutes: 30
Expand Down

0 comments on commit 0b835a8

Please sign in to comment.