Skip to content

Commit

Permalink
ALCS-2227: Configure dependabot
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanrogowsky-oxd committed Feb 27, 2025
1 parent cf0fde4 commit a5fcd6b
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 0 deletions.
87 changes: 87 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# 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"
37 changes: 37 additions & 0 deletions .github/workflows/auto-merge-dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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
run: |
# Get PR number from branch name
PR_NUMBER=$(echo ${{ github.event.workflow_run.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

Check failure

Code scanning / CodeQL

Expression injection in Actions Critical

Potential injection from the ${{ github.event.workflow_run.head_branch }}, which may be controlled by an external user.
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit a5fcd6b

Please sign in to comment.