File tree Expand file tree Collapse file tree 2 files changed +44
-5
lines changed Expand file tree Collapse file tree 2 files changed +44
-5
lines changed Original file line number Diff line number Diff line change @@ -4,14 +4,22 @@ language: node_js
44node_js :
55 - 9
66
7- github-token : $GITHUB_TOKEN
8- before_install : npm install -g greenkeeper-lockfile@1
9- before_script : greenkeeper-lockfile-update
10- after_script : greenkeeper-lockfile-upload
11-
127cache :
138 directories :
149 - " node_modules"
1510
1611git :
1712 depth : false
13+
14+ before_script :
15+ - bash ci/commit-lockfile.sh
16+
17+ after_success :
18+ - bash ci/commit-lockfile.sh
19+
20+ notifications :
21+ email : false
22+ slack :
23+ on_success : change
24+ rooms :
25+ - heyprof:OnsMQaj2FtGkJ972FzpPw60T#pipelines-front
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ echo ` git status`
4+ echo ` git diff`
5+
6+ echo " Should package-lock.json be regenerated?"
7+ # if [[ $TRAVIS_PULL_REQUEST_BRANCH != *"greenkeeper"* ]]; then
8+ # # Not a GreenKeeper Pull Request, aborting
9+ # exit 0
10+ # fi
11+
12+ echo " Cloning repo"
13+ git clone " https://" $GITHUB_TOKEN " @github.com/" $TRAVIS_REPO_SLUG " .git" repo
14+ cd repo
15+
16+ echo " Switching to branch $TRAVIS_PULL_REQUEST_BRANCH "
17+ git checkout $TRAVIS_PULL_REQUEST_BRANCH
18+
19+ echo " Updating lockfile"
20+ npm i
21+
22+ if ! git diff-index --quiet HEAD --; then
23+ echo " Commit and push package-lock.json"
24+ git config --global user.email " $GITHUB_EMAIL "
25+ git config --global user.name " Travis CI"
26+ git config --global push.default simple
27+
28+ git add package-lock.json
29+ git commit -m " chore(*): update yarn.lock"
30+ git push
31+ fi
You can’t perform that action at this time.
0 commit comments