2022-08-29 16:13:25 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-08-30 16:49:59 +03:00
|
|
|
set -e
|
2022-08-29 16:13:25 +03:00
|
|
|
|
|
|
|
if [[ "${SHOULD_BUILD}" != "yes" ]]; then
|
|
|
|
echo "Will not update version JSON because we did not build"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -z "${GITHUB_TOKEN}" ]]; then
|
|
|
|
echo "Will not update insider.json because no GITHUB_TOKEN defined"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2022-08-30 16:49:59 +03:00
|
|
|
echo "$( cat "insider.json" | jq --arg 'tag' "${MS_TAG/\-insider/}" --arg 'commit' "${MS_COMMIT}" '. | .tag=$tag | .commit=$commit' )" > "insider.json"
|
2022-08-30 16:17:00 +03:00
|
|
|
|
|
|
|
git config --global user.email "vscodium-ci@not-real.com"
|
|
|
|
git config --global user.name "VSCodium CI"
|
2022-08-29 16:13:25 +03:00
|
|
|
git add .
|
|
|
|
|
|
|
|
CHANGES=$( git status --porcelain )
|
|
|
|
|
|
|
|
if [[ ! -z "${CHANGES}" ]]; then
|
|
|
|
git commit -m "build(insider): update to commit ${MS_COMMIT:0:7}"
|
2022-08-30 16:17:00 +03:00
|
|
|
|
2022-08-30 16:01:09 +03:00
|
|
|
if ! git push origin insider --quiet; then
|
|
|
|
git pull origin insider
|
|
|
|
git push origin insider --quiet
|
2022-08-29 16:13:25 +03:00
|
|
|
fi
|
|
|
|
fi
|