Skip to content

Commit a655f91

Browse files
Merge pull request #747 from sf-pallavi-das/u/pallavi-das/github_token_update
Adding new github token
2 parents 1bd525e + 6da42c9 commit a655f91

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Salted__Y��D7>K���{�N�x�������凳�A����K���#�81aq��:Xq�

codeship/publish.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@ fi
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+
3142
if [ $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
4059
fi
4160

4261
cp codeship/unencrypted_files/npmrc .npmrc

0 commit comments

Comments
 (0)