Skip to content

Commit

Permalink
test release
Browse files Browse the repository at this point in the history
  • Loading branch information
fqjony committed Dec 5, 2024
1 parent 61ecf95 commit 41a43b3
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,25 @@ jobs:
id: retrieve_digest
env:
DOCKER_USERNAME: "usabilitydynamics"
DOCKER_PASSWORD: ${{ secrets.DOCKER_TOKEN }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
run: |
echo "Fetching digest for tag: ${{ steps.gitversion.outputs.semVer }}"
echo "Fetching OAuth2 token for Docker Hub using token as password"
# Request an OAuth2 access token
TOKEN=$(curl -s -X GET "https://auth.docker.io/token?service=registry.docker.io&scope=repository:usabilitydynamics/udx-worker:pull" \
-u "${DOCKER_USERNAME}:${DOCKER_TOKEN}" | jq -r .token)
if [ -z "${TOKEN}" ]; then
echo "Failed to retrieve OAuth2 token. Check Docker credentials."
exit 1
fi
echo "OAuth2 token retrieved successfully."
# Query the Docker Registry API
RESPONSE_HEADERS=$(curl -sI -H "Accept: application/vnd.docker.distribution.manifest.v2+json" \
-u "${DOCKER_USERNAME}:${DOCKER_PASSWORD}" \
# Fetch the digest using the token
echo "Fetching digest for tag: ${{ steps.gitversion.outputs.semVer }}"
RESPONSE_HEADERS=$(curl -sI -H "Authorization: Bearer ${TOKEN}" \
-H "Accept: application/vnd.docker.distribution.manifest.v2+json" \
"https://registry-1.docker.io/v2/usabilitydynamics/udx-worker/manifests/${{ steps.gitversion.outputs.semVer }}")
# Debug headers
Expand All @@ -83,6 +95,7 @@ jobs:
echo "IMAGE_DIGEST=usabilitydynamics/udx-worker@${DIGEST}" >> $GITHUB_ENV
echo "Image Digest: ${DIGEST}"
- name: Install Cosign
uses: sigstore/[email protected]

Expand Down

0 comments on commit 41a43b3

Please sign in to comment.