File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 1+ Salted__Y��D7>K���{�N�x�������凳�A����K���#�81aq��:Xq�
Original file line number Diff line number Diff line change 2828
2929./codeship/decryptFiles.sh
3030
31+ # Function to get GitHub token for retry (fallback token)
32+ get_fallback_github_token () {
33+ # Read the decrypted GitHub token from the unencrypted files
34+ if [ -f " codeship/unencrypted_files/github_token.enc" ]; then
35+ cat codeship/unencrypted_files/github_token.enc
36+ else
37+ echo " Error: GitHub token file not found" >&2
38+ exit 1
39+ fi
40+ }
41+
3142if [ $CI_BRANCH == " master" ]; then
3243
3344 npm run-script build
@@ -37,6 +48,14 @@ if [ $CI_BRANCH == "master" ]; then
3748 GITHUB_ASSETS=" dist/vlocity-linux,dist/vlocity-macos,dist/vlocity-win.exe"
3849
3950 # publish-release --notes "$P_VERSION" --token $GITHUB --target_commitish $CI_BRANCH --owner vlocityinc --repo vlocity_build --name "v$P_VERSION" --tag "v$P_VERSION" --assets "$GITHUB_ASSETS" --draft
51+ # Try publish-release with existing GITHUB token first
52+ if ! publish-release --notes " $P_VERSION " --token $GITHUB --target_commitish $CI_BRANCH --owner vlocityinc --repo vlocity_build --name " v$P_VERSION " --tag " v$P_VERSION " --assets " $GITHUB_ASSETS " --draft; then
53+ echo " Publish-release failed with existing token, retrying with fallback token..."
54+ # Use the fallback GitHub token for retry
55+ FALLBACK_TOKEN=$( get_fallback_github_token)
56+ export GITHUB=" $FALLBACK_TOKEN "
57+ publish-release --notes " $P_VERSION " --token $GITHUB --target_commitish $CI_BRANCH --owner vlocityinc --repo vlocity_build --name " v$P_VERSION " --tag " v$P_VERSION " --assets " $GITHUB_ASSETS " --draft
58+ fi
4059fi
4160
4261cp codeship/unencrypted_files/npmrc .npmrc
You can’t perform that action at this time.
0 commit comments