Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update manifest polling #19

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions .github/workflows/release-artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,27 @@ jobs:
steps:
- name: Check if Docker image exists with current version
id: check_image
env:
VERSION: ${{ needs.get-version.outputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION=${{ needs.get-version.outputs.version }}
IMAGE_NAME="ghcr.io/dyllamt/coinbase-connector:$VERSION"
if curl -f -sL $IMAGE_NAME > /dev/null; then
REGISTRY="ghcr.io"
REPO="dyllamt/coinbase-connector"
TAG="$VERSION"
MANIFEST_URL="https://$REGISTRY/v2/$REPO/manifests/$TAG"

AUTH_HEADER="Authorization: Bearer $GITHUB_TOKEN"
ACCEPT_HEADER="Accept: application/vnd.docker.distribution.manifest.v2+json"
HEADERS="-H \"$ACCEPT_HEADER\" -H \"$AUTH_HEADER\""

CURL_OPTIONS="-f -sL"

if curl $CURL_OPTIONS $HEADERS "$MANIFEST_URL" > /dev/null; then
echo "Docker image with version $VERSION exists."
echo "should_release=false" >> $GITHUB_OUTPUT
echo "should_release=false" >> $GITHUB_ENV
else
echo "Docker image with version $VERSION does not exist."
echo "should_release=true" >> $GITHUB_OUTPUT
echo "should_release=true" >> $GITHUB_ENV
fi

check-version-check:
Expand Down
Loading