Skip to content

Commit a0a1986

Browse files
committed
test new action
1 parent a4f9687 commit a0a1986

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

.github/workflows/publish_container.yaml

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Create and publish a Docker image
33

44
on:
55
release:
6-
types: [published]
6+
types: [created]
77
workflow_dispatch:
88

99
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
@@ -43,26 +43,22 @@ jobs:
4343
tags: |
4444
type=ref,event=branch
4545
type=sha,format=long
46-
- name: Get Release ID
47-
id: get_release
48-
run: |
49-
RELEASE_RESPONSE=$(curl \
50-
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
51-
-H "Accept: application/vnd.github+json" \
52-
https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ github.ref_name }})
53-
echo "RELEASE_ID=$(echo "$RELEASE_RESPONSE" | jq .id)" >> $GITHUB_ENV
54-
55-
- name: Update Release Body
56-
if: env.RELEASE_ID != ''
57-
run: |
58-
BODY="Docker Image Tag: ${{ steps.meta.outputs.tags }}\\n\\n```\ndocker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags }}\n```\n\nVerify the contents of the image:\n```\ngh attestation verify oci://${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags }} --owner ${{ github.actor }}\n```"
59-
curl -X PATCH \
60-
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
61-
-H "Accept: application/vnd.github+json" \
62-
-d "{\"body\": \"$BODY\"}" \
63-
https://api.github.com/repos/${{ github.repository }}/releases/${{ env.RELEASE_ID }}
46+
- name: update release
47+
id: update_release
48+
uses: tubone24/[email protected]
6449
env:
65-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
50+
GITHUB_TOKEN: ${{ github.token }}
51+
with:
52+
body: |
53+
Docker Image Tag: ${{ steps.meta.outputs.tags }}
54+
```
55+
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags }}
56+
```
57+
Verify the contents of the image:
58+
```
59+
gh attestation verify oci://${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags }} --owner ${{ github.actor }}
60+
```
61+
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
6662
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository.
6763
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
6864
- name: Build and push Docker image

0 commit comments

Comments
 (0)