Skip to content

Commit

Permalink
reuse digest
Browse files Browse the repository at this point in the history
  • Loading branch information
taukakao committed Nov 29, 2024
1 parent 4d8fec4 commit 9a53648
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/release-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
id-token: write # Additional permissions for the persistence of the attestations
outputs:
uploaded_image: ${{ steps.push.outputs.uploaded_image }}
uploaded_digest: ${{ steps.push.outputs.uploaded_digest }}

steps:
- name: Generate image name
Expand Down Expand Up @@ -107,6 +108,7 @@ jobs:
docker push "$IMAGE_URL_UPLOAD"
IMAGE_DIGEST="$(docker image inspect $IMAGE_URL_UPLOAD | jq -r '.[0].RepoDigests[0]' | cut -d '@' -f2)"
echo "IMAGE_DIGEST=$IMAGE_DIGEST" >> "$GITHUB_ENV"
echo "uploaded_digest=$IMAGE_DIGEST" >> "$GITHUB_OUTPUT"
- name: what
run: |
Expand Down Expand Up @@ -138,18 +140,10 @@ jobs:
apt-get install -y curl
IMAGE_DIGEST=$(curl -s -L -H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/users/${{ github.repository_owner }}/packages/container/desktop/versions | grep -m1 name | sed -E 's/^\s*"name": "(.+)".*$/\1/')
echo "${IMAGE_DIGEST}"
echo "${PACKAGE_LIST}"
curl -X POST \
-H 'Accept:application/json' \
-H "Authorization:Basic $(echo -n "${{ secrets.DIFFER_USER }}:${{ secrets.DIFFER_PSW }}" | base64)" \
-d "{\"digest\":\"${IMAGE_DIGEST}\",${PACKAGE_LIST}}" \
-d "{\"digest\":\"${{ needs.build.outputs.uploaded_digest }}\",${PACKAGE_LIST}}" \
${{ vars.DIFFER_URL }}/images/desktop/new
lpkg --lock

0 comments on commit 9a53648

Please sign in to comment.