Skip to content

Commit b6130f6

Browse files
committed
bumped skopeo and fixed check image step for retrieving current registry tags
1 parent 7ffca72 commit b6130f6

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
with:
5353
uri: 'https://github.com/lework/skopeo-binary/releases/download/v1.17.0/skopeo-linux-amd64'
5454
name: 'skopeo'
55-
version: 'v1.17.0'
55+
version: 'v1.20.0'
5656

5757
- name: Get PHP versions
5858
id: check_version
@@ -83,15 +83,14 @@ jobs:
8383
GHCR_SLUG: ${{ env.GHCR_SLUG }}
8484
run: |
8585
# Retrieve current registry tags
86-
ENCODED_TOKEN=$(echo -n "${{ secrets.GITHUB_TOKEN }}" | base64 -w 0)
87-
RESPONSE=$(curl -s -H "Authorization: Bearer ${ENCODED_TOKEN}" https://ghcr.io/v2/${GHCR_SLUG#ghcr.io/}/tags/list)
86+
RESPONSE=$(skopeo list-tags "docker://${GHCR_SLUG}" --creds "${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}")
8887
8988
# In case of a new GitHub repository, or has registry but without any tags without any tags yet
90-
if echo "$RESPONSE" | jq -e '.errors' >/dev/null 2>&1 || echo "$RESPONSE" | jq -e '.tags == null' >/dev/null 2>&1; then
89+
if echo "$RESPONSE" | jq -e '.errors' >/dev/null 2>&1 || echo "$RESPONSE" | jq -e '.Tags == null' >/dev/null 2>&1; then
9190
if echo "$RESPONSE" | jq -e '.errors' >/dev/null 2>&1; then
9291
MESSAGE=$(echo "$RESPONSE" | jq -e '.errors[0].message')
9392
else
94-
MESSAGE=$(echo "$RESPONSE" | jq -e '.tags // "empty"')
93+
MESSAGE=$(echo "$RESPONSE" | jq -e '.Tags // "empty"')
9594
fi
9695
9796
echo "No tags found (Response: $MESSAGE). Proceed to build step."
@@ -104,7 +103,7 @@ jobs:
104103
fi
105104
106105
# Current released php versions from GitHub packages
107-
PACKAGE_PHP_VERSIONS=$(echo "$RESPONSE" | jq -r '.tags[]' | grep -oP '^\d+(\.\d+){0,2}(?=-)' | sort -uV | jq -R . | jq -s .)
106+
PACKAGE_PHP_VERSIONS=$(echo "$RESPONSE" | jq -r '.Tags[]' | grep -oP '^\d+(\.\d+){0,2}(?=-)' | sort -uV | jq -R . | jq -s .)
108107
109108
# Check which PHP tags already exists; remove already existing ones from list if "force" input was not provided
110109
CURRENT_PHP_VERSIONS=${{ steps.check_version.outputs.php_versions }}

0 commit comments

Comments
 (0)