Skip to content

Commit 5d33d9f

Browse files
committed
test
1 parent 99f82ac commit 5d33d9f

File tree

2 files changed

+44
-5
lines changed

2 files changed

+44
-5
lines changed

.travis.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,22 @@ language: node_js
44
node_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-
127
cache:
138
directories:
149
- "node_modules"
1510

1611
git:
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

ci/commit-lockfile.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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

0 commit comments

Comments
 (0)