File tree 2 files changed +13
-10
lines changed 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 78
78
# Deploy stage.
79
79
# Here we build the package JSON (always) and do the deployments
80
80
- name : " Package / deploy"
81
- if : type != pull_request
82
81
stage : deploy
83
82
script : $TRAVIS_BUILD_DIR/tests/common.sh
84
83
env : BUILD_TYPE=package
Original file line number Diff line number Diff line change @@ -127,19 +127,23 @@ cat $srcdir/package/package_esp8266com_index.template.json | \
127
127
# Use Github API token, must be available
128
128
curl_gh_token_arg=()
129
129
if [ -z " $CI_GITHUB_API_KEY " ]; then
130
- echo " curl: API key not present, exit with error"
131
- exit 1
130
+ echo " curl: API key not present"
131
+ else
132
+ echo " curl: API key is present"
133
+ curl_gh_token_arg=(-H " Authorization: token $CI_GITHUB_API_KEY " )
132
134
fi
133
- curl_gh_token_arg=(-H " Authorization: token $CI_GITHUB_API_KEY " )
134
-
135
- # test
136
- # echo "key was '$CI_GITHUB_API_KEY'"
137
- # this key (below) is working, the overwritten key is not empty
138
- # CI_GITHUB_API_KEY="vt6StBC+ghqnh8YrreNo3wAzGGddJ2S4YpVZkz4S84xLEGWkIEghQhTrjlhzjBsrnHfLNko4tz9EsNx0yQ8yBlPOdReETGAkqnAU7PSPFss0qGcCRUXYtozNjbFQq6TWIxECK4xq40R9tE6NyeOpm9AYJtwF/v18u2T+T9qSgGQ="
139
135
140
136
# Get previous release name
141
137
echo " ======== curl dumped header"
142
- curl --silent -D /dev/stderr ${curl_gh_token_arg[@]} https://api.github.com/repos/esp8266/Arduino/releases > releases.json
138
+ if ! curl --silent -D /dev/stderr ${curl_gh_token_arg[@]} https://api.github.com/repos/esp8266/Arduino/releases > releases.json; then
139
+ if [ -z " $CI_GITHUB_API_KEY " ]; then
140
+ echo " ---- Bad moon phase, in a PR, exit successfully"
141
+ exit 0
142
+ else
143
+ echo " ---- Please debug curl request, exit with error"
144
+ exit 1
145
+ fi
146
+ fi
143
147
echo " ======== curl"
144
148
145
149
# Previous final release (prerelase == false)
You can’t perform that action at this time.
0 commit comments