Skip to content

Commit 9e1b2ae

Browse files
Merge pull request #550 from mlibrary/dependabot-multi-ecosystem
Updating dependabot to multi-ecosystem. Adding ESLint workflow for PRs.
2 parents aab0cea + 428455f commit 9e1b2ae

File tree

6 files changed

+60
-104
lines changed

6 files changed

+60
-104
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @erinesullivan

.github/PULL_REQUEST_TEMPLATE/dependency_updates_template.md

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 22 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,31 @@
11
version: 2
2+
3+
multi-ecosystem-groups:
4+
maintenance:
5+
schedule:
6+
interval: "cron"
7+
cronjob: "0 6 1-7 * 1" # Every first Monday of the month at 6:00am
8+
timezone: "America/Detroit"
9+
commit-message:
10+
prefix: "Monthly dependency updates: "
11+
assignees: ["erinesullivan"]
12+
13+
214
updates:
315
# For npm dependencies
416
- package-ecosystem: "npm"
517
directory: "/"
6-
schedule:
7-
interval: "monthly"
8-
time: "06:00"
9-
day: "monday"
10-
timezone: "America/Detroit"
11-
commit-message:
12-
prefix: "Monthly npm updates: "
13-
open-pull-requests-limit: 5
14-
reviewers:
15-
- "erinesullivan"
16-
labels:
17-
- "dependencies"
18-
groups:
19-
group-all-npm-updates:
20-
patterns:
21-
- "*"
18+
multi-ecosystem-group: "maintenance"
19+
patterns: ["*"]
2220

2321
# For GitHub Actions updates
2422
- package-ecosystem: "github-actions"
2523
directory: "/"
26-
schedule:
27-
interval: "monthly"
28-
time: "06:00"
29-
day: "monday"
30-
timezone: "America/Detroit"
31-
commit-message:
32-
prefix: "Monthly action updates: "
33-
open-pull-requests-limit: 5
34-
reviewers:
35-
- "erinesullivan"
36-
labels:
37-
- "dependencies"
38-
groups:
39-
group-all-github-actions-updates:
40-
patterns:
41-
- "*"
24+
multi-ecosystem-group: "maintenance"
25+
patterns: ["*"]
26+
27+
# For Docker updates
28+
- package-ecosystem: "docker"
29+
directory: "/"
30+
multi-ecosystem-group: "maintenance"
31+
patterns: ["*"]

.github/workflows/dependabot.yml

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,23 @@
1-
name: Update dependabot pull request title
1+
name: Dependabot pull requests
22

33
on:
44
pull_request:
5-
types: [opened]
65

76
jobs:
8-
update-title:
7+
dependabot:
8+
name: Auto-merge Dependabot PRs
99
runs-on: ubuntu-latest
10+
if: ${{github.event.pull_request.user.login == 'dependabot[bot]'}}
1011
permissions:
1112
pull-requests: write
13+
contents: write
14+
env:
15+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
16+
PR_URL: ${{github.event.pull_request.html_url}}
1217
steps:
13-
- uses: actions/checkout@v5
14-
- name: Check conditions
15-
id: check_conditions
16-
run: |
17-
if [[ "${{ github.event.pull_request.user.login }}" != "dependabot[bot]" ]]; then
18-
echo "Author does not match."
19-
exit 0
20-
fi
21-
labels=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
22-
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels | jq -r '.[].name')
23-
if [[ $labels != *"dependencies"* ]]; then
24-
echo "Label does not match."
25-
exit 0
26-
fi
27-
echo "conditions_met=true" >> $GITHUB_ENV
28-
- name: Update PR title
29-
if: env.conditions_met == 'true'
30-
run: |
31-
NEW_TITLE="$(date +'%B %Y') dependency updates."
32-
curl -X PATCH \
33-
-H "Accept: application/vnd.github+json" \
34-
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
35-
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }} \
36-
-d "{\"title\":\"${NEW_TITLE}\"}"
37-
env:
38-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
- name: Fetch Dependabot Metadata
19+
uses: dependabot/fetch-metadata@v2
20+
with:
21+
github-token: "${{ secrets.GITHUB_TOKEN }}"
22+
- name: Merge the PR
23+
run: gh pr merge --squash --auto "$PR_URL"

.github/workflows/dockerhub-unstable.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on: [push, pull_request]
55
jobs:
66
build:
77
runs-on: ubuntu-latest
8+
if: ${{github.actor != 'dependabot[bot]'}}
89
steps:
910
- name: Login to DockerHub
1011
uses: docker/login-action@v3
@@ -21,5 +22,3 @@ jobs:
2122
- name: Image digest
2223
run: |
2324
echo '${{ steps.docker_build.outputs.digest }}'
24-
25-

.github/workflows/pull-request.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
lint:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v5
12+
with:
13+
fetch-depth: 0
14+
- name: Install latest LTS version of Node.js
15+
uses: actions/setup-node@v5
16+
with:
17+
node-version: lts/*
18+
check-latest: true
19+
- name: Clean install
20+
run: npm ci
21+
- name: Run ESLint
22+
run: npm run lint

0 commit comments

Comments
 (0)