File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7070 - name : Get latest upstream version
7171 id : upstream
7272 run : |
73- TAG =$(curl -sL \
73+ RESPONSE =$(curl -fsSL \
7474 -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
75- "https://api.github.com/repos/${{ matrix.upstream_repo }}/releases?per_page=100" \
75+ -H "Accept: application/vnd.github+json" \
76+ -H "X-GitHub-Api-Version: 2022-11-28" \
77+ "https://api.github.com/repos/${{ matrix.upstream_repo }}/releases?per_page=100")
78+
79+ if ! echo "$RESPONSE" | jq -e 'type == "array"' > /dev/null 2>&1; then
80+ echo "::error::GitHub API did not return an array for ${{ matrix.upstream_repo }}/releases. Response: $(echo "$RESPONSE" | jq -c .)"
81+ exit 1
82+ fi
83+
84+ TAG=$(echo "$RESPONSE" \
7685 | jq -r --arg prefix "${{ matrix.tag_prefix }}" \
7786 '[.[] | select(.tag_name | startswith($prefix) and (contains("/") | not))] | first | .tag_name | ltrimstr($prefix)')
7887 echo "version=$TAG" >> $GITHUB_OUTPUT
You can’t perform that action at this time.
0 commit comments