File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4242
4343 - name : Get AppBuilder Version
4444 run : |
45+ # Get tag from GHCR
4546 TOKEN_JSON=$(curl https://ghcr.io/token\?scope\="repository:sillsdev/app-builders:pull")
46- TOKEN=$(echo $TOKEN_JSON | jq ".token")
47- curl -H "Authorization: Bearer $TOKEN" https://ghcr.io/v2/sillsdev/app-builders/tags/list
47+ TOKEN=$(echo "$TOKEN_JSON" | jq -r ".token")
48+ TAG_DATA=$(curl -H "Authorization: Bearer $TOKEN" https://ghcr.io/v2/sillsdev/app-builders/tags/list)
49+ NUM_TAGS=$(echo "$TAG_DATA" | jq -r '.tags | length')
50+ FROM_GHCR=$(echo "$TAG_DATA" | jq -r ".tags[$(("$NUM_TAGS" - 1))]")
51+ echo "Latest tag of sillsdev/app-builders is: $FROM_GHCR"
52+ # Get version from package.json
53+ FROM_PACKAGE=$(jq -r ".version" "package.json")
54+ echo "Latest version of sillsdev/appbuilder-pwa is: $FROM_PACKAGE"
55+ if [ "$FROM_GHCR" != "$FROM_PACKAGE" ]; then
56+ echo "version in package.json does not match latest version from ghcr"
57+ exit 1
58+ fi
4859
4960
You can’t perform that action at this time.
0 commit comments