Skip to content

Commit

Permalink
Merge pull request #2193 from bcgov/backport/pr-2188
Browse files Browse the repository at this point in the history
Backport: ALCS-2227: Configure dependabot
  • Loading branch information
dylanrogowsky-oxd authored Mar 4, 2025
2 parents 97bbfca + f4de4b2 commit 344beae
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 0 deletions.
88 changes: 88 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm"
directory: "/alcs-frontend"
schedule:
interval: "daily"
target-branch: "develop"
commit-message:
prefix: "ALCS-000"
allow:
- dependency-type: "direct"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
groups:
npm-security:
applies-to: security-updates
patterns:
- "*"
update-types:
- "minor"
- "patch"
npm-minor-and-patch:
applies-to: version-updates
patterns:
- "*"
update-types:
- "minor"
- "patch"
- package-ecosystem: "npm"
directory: "/portal-frontend"
schedule:
interval: "daily"
target-branch: "develop"
commit-message:
prefix: "ALCS-000"
allow:
- dependency-type: "direct"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
groups:
npm-security:
applies-to: security-updates
patterns:
- "*"
update-types:
- "minor"
- "patch"
npm-minor-and-patch:
applies-to: version-updates
patterns:
- "*"
update-types:
- "minor"
- "patch"
- package-ecosystem: "npm"
directory: "/services"
schedule:
interval: "daily"
target-branch: "develop"
commit-message:
prefix: "ALCS-000"
allow:
- dependency-type: "direct"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
groups:
npm-security:
applies-to: security-updates
patterns:
- "*"
update-types:
- "minor"
- "patch"
npm-minor-and-patch:
applies-to: version-updates
patterns:
- "*"
update-types:
- "minor"
- "patch"
38 changes: 38 additions & 0 deletions .github/workflows/auto-merge-dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Auto-merge Dependabot PRs

on:
pull_request:
branches:
- develop
workflow_run:
workflows: ["CI"]
types:
- completed

permissions:
contents: write
pull-requests: write

jobs:
auto-merge:
runs-on: ubuntu-latest
if: |
github.actor == 'dependabot[bot]' &&
github.event_name == 'workflow_run' &&
github.event.workflow_run.conclusion == 'success'
steps:
- name: Auto-merge Dependabot PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
run: |
# Get PR number from branch name
PR_NUMBER=$(echo "$HEAD_BRANCH" | grep -o '[0-9]\+' || echo '')
if [ -n "$PR_NUMBER" ]; then
# Approve PR
gh pr review $PR_NUMBER --approve
# Enable auto-merge
gh pr merge $PR_NUMBER --auto --merge
fi

0 comments on commit 344beae

Please sign in to comment.