This commit is contained in:
Core 2022-08-04 18:43:31 +01:00
parent 052dc648da
commit 2d09ae1f4e
No known key found for this signature in database
GPG key ID: FE9BF1B547F8F3C6
2 changed files with 7 additions and 3 deletions

View file

@ -36,9 +36,8 @@ jobs:
- name: Change Version
env:
REQUEST_TOKEN: ${{ secrets.RELEASE_TOKEN }}
GH_REQUEST_TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: |
curl -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" https://api.github.com/repos/ciderapp/Cider/branches/stable | grep '"sha"' | head -1 | cut -d '"' -f 4
sudo chmod +x resources/version.sh && ./resources/version.sh || true
- name: Sign in to EVS

View file

@ -1,7 +1,12 @@
#!/bin/bash
# Setup the variables needed
STABLE_SHA=$(curl -H "Authorization: token ${REQUEST_TOKEN}" https://api.github.com/repos/ciderapp/Cider/branches/stable | grep '"sha"' | head -1 | cut -d '"' -f 4)
if [[ $GITHUB_REF_NAME == "main" ]]; then
STABLE_SHA=$(curl -H "Authorization: token ${GH_REQUEST_TOKEN}" https://api.github.com/repos/ciderapp/Cider/branches/stable | grep '"sha"' | head -1 | cut -d '"' -f 4)
else
STABLE_SHA=$(curl -H "Authorization: token ${GITHUB_TOKEN}" https://api.github.com/repos/ciderapp/Cider/branches/main | grep '"sha"' | head -1 | cut -d '"' -f 4)
fi
SHA_DATE=$(git show -s --format=%ci $STABLE_SHA)
COMMIT_SINCE_STABLE=$(git rev-list $STABLE_SHA..HEAD --count --since="$SHA_DATE")
CURRENT_VERSION=$(node -p -e "require('./package.json').version")