Update Travis config for new token
This commit is contained in:
parent
705c9bcfd2
commit
06e8cedc0d
|
@ -13,6 +13,9 @@ cache:
|
|||
- $HOME/.yarn-cache
|
||||
before_install:
|
||||
- |
|
||||
echo "machine github.com login reactjs-bot password $GITHUB_TOKEN" >~/.netrc
|
||||
unset GITHUB_TOKEN
|
||||
|
||||
if [ "$TEST_TYPE" != build_website ] && \
|
||||
! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)|(^(docs|examples))/'
|
||||
then
|
||||
|
@ -35,7 +38,6 @@ script:
|
|||
set -e
|
||||
|
||||
GH_PAGES_DIR="$TRAVIS_BUILD_DIR"/../react-gh-pages
|
||||
echo "machine github.com login reactjs-bot password $GITHUB_TOKEN" >~/.netrc
|
||||
git config --global user.name "$GITHUB_USER_NAME"
|
||||
git config --global user.email "$GITHUB_USER_EMAIL"
|
||||
|
||||
|
@ -121,7 +123,7 @@ env:
|
|||
# SECRET_TOKEN
|
||||
- secure: dkpPW+VnoqC/okhRdV90m36NcyBFhcwEKL3bNFExAwi0dXnFao8RoFlvnwiPlA23h2faROkMIetXlti6Aju08BgUFV+f9aL6vLyU7gUent4Nd3413zf2fwDtXIWIETg6uLnOpSykGKgCAT/hY3Q2oPLqOoY0OxfgnbqwxkxljrE=
|
||||
# GITHUB_TOKEN
|
||||
- secure: EHCyCSKMwKlLHNtcj9nmkRzmiiPE3aDGlPcnEyrDJeRI0SeN/iCXHXfFivR0vFq3vr+9naMBczAR2AEidtps5KbJrKqdZnjPFRbmfVtzWr/LlvVCub3u13Pub6TdKIVBTny1PuZ5X8GvdxMNVig89jGjvzhhWuQRaz3VhJnTra4=
|
||||
- secure: Sn+HwLSkbgM5MqVszq/CJHcOsZax17zwW0ILpGgAaEKD6MHNmEBdc71skaLr+6R4gHVO5ybV2cgSxHuBLHKzYoidq5ksGKRHNeXfyOv8jeHGTN/FjwMQbM+WkIK3wFroLsuQ1kW2FBfFEXqx4rET6GXwdcqycGl8GSFB1l0VNzE=
|
||||
# COVERALLS_TOKEN
|
||||
- secure: h/cUq+TrUMZOQmkFD7CvuwX0uAwmjIfKZ4qSUzY+QzUtDzOzA0L/XF84xTBq1Q5YYsEiaoF6GxxGCdrLQiBA/ZTd+88UHgeZPMRvi0xG9Q+PeePVOsZMTxy4/WWFgOfSQCk49Mj9zizGgO78i6vxq+SDXMtFHnZ+TpPJIEW6/m0=
|
||||
notifications:
|
||||
|
|
|
@ -21,10 +21,7 @@ function escape(value) {
|
|||
|
||||
var cwd = null;
|
||||
function exec(command) {
|
||||
console.error('>', command.replace(process.env.GITHUB_TOKEN, '************'));
|
||||
var options = {
|
||||
stdio: [null, null, null],
|
||||
};
|
||||
var options = {};
|
||||
if (cwd) {
|
||||
options.cwd = cwd;
|
||||
}
|
||||
|
@ -45,7 +42,7 @@ if (isInsideOfTravis) {
|
|||
process.exit(0);
|
||||
}
|
||||
|
||||
if (!process.env.GITHUB_USER || !process.env.GITHUB_TOKEN) {
|
||||
if (!process.env.GITHUB_USER) {
|
||||
console.error(
|
||||
'In order to use facts-tracker, you need to configure a ' +
|
||||
'few environment variables in order to be able to commit to the ' +
|
||||
|
@ -60,8 +57,6 @@ if (isInsideOfTravis) {
|
|||
'In a different tab, go to https://travis-ci.org/' +
|
||||
process.env.TRAVIS_REPO_SLUG + '/settings\n' +
|
||||
' - Make sure "Build only if .travis.yml is present" is ON\n' +
|
||||
' - Fill "Name" with "GITHUB_TOKEN" and "Value" with the token you ' +
|
||||
'just generated. Press "Add"\n' +
|
||||
' - Fill "Name" with "GITHUB_USER" and "Value" with the name of the ' +
|
||||
'account you generated the token with. Press "Add"\n' +
|
||||
'\n' +
|
||||
|
@ -71,10 +66,6 @@ if (isInsideOfTravis) {
|
|||
process.exit(1);
|
||||
}
|
||||
|
||||
exec(
|
||||
'echo "machine github.com login $GITHUB_USER password $GITHUB_TOKEN"' +
|
||||
'> ~/.netrc'
|
||||
);
|
||||
exec(
|
||||
'git config --global user.name ' +
|
||||
escape(process.env.GITHUB_USER_NAME || 'facts-tracker')
|
||||
|
@ -102,7 +93,7 @@ function getRepoSlug() {
|
|||
return match[1];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
console.error('Cannot find repository slug, sorry.');
|
||||
process.exit(1);
|
||||
}
|
||||
|
@ -118,7 +109,7 @@ function checkoutFactsFolder() {
|
|||
if (!fs.existsSync(factsFolder)) {
|
||||
var escapedRepoURL;
|
||||
if (isInsideOfTravis) {
|
||||
escapedRepoURL = 'https://$GITHUB_TOKEN@github.com/' + escape(repoSlug) + '.git';
|
||||
escapedRepoURL = 'https://$GITHUB_USER@github.com/' + escape(repoSlug) + '.git';
|
||||
} else {
|
||||
escapedRepoURL = escape('git@github.com:' + repoSlug + '.git');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue