Skip to content

Commit e145aa4

Browse files
Enable dependabot automatic updates
1 parent 36f860f commit e145aa4

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

.github/depandabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
day: "thursday" # Gives us a working day to merge this before our typical release
8+
labels:
9+
- "Update dependencies"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Update dependencies
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
update:
7+
name: Update dependencies
8+
runs-on: macos-latest
9+
if: contains(github.event.pull_request.labels.*.name, 'Update dependencies')
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v2
13+
14+
- name: Remove PR label
15+
env:
16+
REPOSITORY: '${{ github.repository }}'
17+
PR_NUMBER: '${{ github.event.pull_request.number }}'
18+
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
19+
run: |
20+
gh api "repos/$REPOSITORY/issues/$PR_NUMBER/labels/Update%20dependencies" -X DELETE
21+
22+
- name: Push updated dependencies
23+
env:
24+
BRANCH: '${{ github.head_ref }}'
25+
run: |
26+
git fetch
27+
git checkout $BRANCH
28+
sudo npm install --force -g npm@latest
29+
npm install
30+
npm ci
31+
npm run removeNPMAbsolutePaths
32+
git config --global user.email "github-actions@github.com"
33+
git config --global user.name "github-actions[bot]"
34+
git add node_modules
35+
git commit -am "Update checked-in dependencies"
36+
git push
37+

0 commit comments

Comments
 (0)