-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (50 loc) · 1.4 KB
/
npm-upgrade.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
52
53
54
55
56
57
name: npm upgrade
on:
push:
branches:
- main
paths:
# Build when there are changes to this workflow file
- '.github/workflows/npm-upgrade.yml'
schedule:
# A weekly build to pick up updates and security patches for libraries
- cron: "0 12 * * 2"
env:
userName: Github actions
userEmail: [email protected]
jobs:
dependency-upgrades:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: git setup
run: |
git config --global user.name "${userName}"
git config --global user.email "${userEmail}"
- name: npm upgrades
run: |
upgrade () {
cd ${GITHUB_WORKSPACE}/$1
echo " - Upgrading ${PWD##*/}"
npm upgrade
git commit -m "Automated upgrade" package-lock.json || true # Ignore error if no change
}
upgrade .infrastructure
upgrade metrics
upgrade slack
upgrade static
- name: git push
run: |
git pull --rebase # just in case anything else has been pushed
git push
- name: Notify Slack
if: failure()
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_USERNAME: Pingmyhouse build
SLACK_COLOR: ${{ job.status }}
SLACK_ICON_EMOJI: ":github_octocat:"
SLACK_CHANNEL: build