-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (43 loc) · 1.25 KB
/
auto-update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Update npm dependencies
on:
schedule:
- cron: '30 12 4,18 * *'
workflow_dispatch:
jobs:
update-dependencies:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
- name: Update npm dependencies
run: |
npm version patch --no-git-tag-version
npm update
npm run build
npm run test --if-present
- name: Create Private Key for SSH
run: |
touch /tmp/github-actions-bot
chmod 600 /tmp/github-actions-bot
echo "${{ secrets.REPO_DEPLOY_KEY }}" > /tmp/github-actions-bot
- name: Commit and push changes
uses: EndBug/add-and-commit@v9
env:
GIT_SSH_COMMAND: "ssh -i /tmp/github-actions-bot -o StrictHostKeyChecking=no"
with:
add: 'package*.json'
author_name: 'github-actions[bot]'
author_email: 'github-actions[bot]@users.noreply.github.com'
fetch: false
message: 'Npm deps update'
pathspec_error_handling: exitImmediately
pull: '--rebase --autostash'
- name: Cleanup
run: |
unset REPO_DEPLOY_KEY
rm -rf /tmp/*