Skip to content

Commit c606660

Browse files
authored
Merge pull request #38 from DataSQRL/dependabot/maven/org.postgresql-postgresql-42.7.5
Bump org.postgresql:postgresql from 42.5.0 to 42.7.5
2 parents 4438e97 + d3681c7 commit c606660

File tree

2 files changed

+25
-80
lines changed

2 files changed

+25
-80
lines changed

.github/workflows/delete-pr-images.yml

Lines changed: 24 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -13,102 +13,47 @@ jobs:
1313
FLINK_PROFILE: [flink-1.19, flink-1.20]
1414

1515
steps:
16-
- name: Delete GHCR image via GitHub GraphQL API
16+
- name: Delete GHCR image via GitHub REST API
1717
env:
1818
GH_USERNAME: ${{ secrets.PAT_USERNAME }}
1919
GH_PASSWORD: ${{ secrets.PAT_PASSWORD }}
20+
ORG: DataSQRL
21+
PACKAGE: flink-sql-runner
22+
TAG: pr-${{ github.event.number }}-${{ matrix.FLINK_PROFILE }}
2023
run: |
2124
set -euxo pipefail
2225
23-
OWNER="datasqrl"
24-
PACKAGE_NAME="flink-sql-runner"
25-
TAG="pr-${{ github.event.number }}-${{ matrix.FLINK_PROFILE }}"
26+
echo "🔐 Generating basic auth token..."
27+
TOKEN_BASE64=$(echo -n "$GH_USERNAME:$GH_PASSWORD" | base64)
2628
27-
echo "🔐 Authenticating and generating bearer token for GitHub GraphQL API..."
29+
echo "🔍 Getting package versions for $ORG/$PACKAGE..."
2830
29-
# Get GitHub API token using basic auth
30-
BEARER_TOKEN=$(curl -s -u "$GH_USERNAME:$GH_PASSWORD" \
31-
-H "Content-Type: application/json" \
32-
-d '{"scopes":["read:packages", "delete:packages"],"note":"Delete GHCR action"}' \
33-
https://api.github.com/authorizations | jq -r '.token')
31+
VERSION_LIST=$(curl -s \
32+
-H "Authorization: Basic $TOKEN_BASE64" \
33+
-H "Accept: application/vnd.github+json" \
34+
"https://api.github.com/orgs/$ORG/packages/container/$PACKAGE/versions")
3435
35-
if [[ -z "$BEARER_TOKEN" || "$BEARER_TOKEN" == "null" ]]; then
36-
echo "❌ Failed to acquire bearer token."
37-
exit 1
38-
fi
39-
40-
echo "🔍 Searching for GHCR package version with tag: $TAG"
41-
42-
QUERY=$(jq -nc --arg owner "$OWNER" --arg name "$PACKAGE_NAME" '
43-
{
44-
query: "query($owner:String!, $name:String!) {
45-
repository(owner: $owner, name: $name) {
46-
packages(first: 50, packageType: CONTAINER, names: [\"flink-sql-runner\"]) {
47-
nodes {
48-
name
49-
versions(first: 100) {
50-
nodes {
51-
id
52-
version
53-
tags
54-
}
55-
}
56-
}
57-
}
58-
}
59-
}",
60-
variables: {
61-
owner: $owner,
62-
name: $name
63-
}
64-
}')
65-
66-
RESPONSE=$(curl -s \
67-
-H "Authorization: Bearer $BEARER_TOKEN" \
68-
-H "Content-Type: application/json" \
69-
-H "Accept: application/vnd.github.package-deletes-preview+json" \
70-
-d "$QUERY" https://api.github.com/graphql)
36+
echo "📦 Searching for tag: $TAG..."
7137
72-
echo "GraphQL query result:"
73-
echo "$RESPONSE" | jq
74-
75-
PACKAGE_VERSION_ID=$(echo "$RESPONSE" | jq -r \
76-
--arg TAG "$TAG" \
77-
'.data.repository.packages.nodes[].versions.nodes[]
78-
| select(.tags[]? == $TAG)
79-
| .id')
38+
PACKAGE_VERSION_ID=$(echo "$VERSION_LIST" | jq -r --arg TAG "$TAG" '
39+
.[] | select(.metadata.container.tags[]? == $TAG) | .id' | head -n 1)
8040
8141
if [[ -z "$PACKAGE_VERSION_ID" || "$PACKAGE_VERSION_ID" == "null" ]]; then
82-
echo "❌ No matching package version found for tag $TAG"
42+
echo "❌ Package version with tag $TAG not found."
8343
exit 1
8444
fi
8545
86-
echo "✅ Found package version ID: $PACKAGE_VERSION_ID"
87-
88-
DELETE_MUTATION=$(jq -nc --arg id "$PACKAGE_VERSION_ID" '
89-
{
90-
query: "mutation($id: ID!) {
91-
deletePackageVersion(input: {packageVersionId: $id}) {
92-
success
93-
}
94-
}",
95-
variables: { id: $id }
96-
}')
97-
98-
DELETE_RESPONSE=$(curl -s \
99-
-H "Authorization: Bearer $BEARER_TOKEN" \
100-
-H "Content-Type: application/json" \
101-
-H "Accept: application/vnd.github.package-deletes-preview+json" \
102-
-d "$DELETE_MUTATION" https://api.github.com/graphql)
103-
104-
echo "Delete mutation result:"
105-
echo "$DELETE_RESPONSE" | jq
46+
echo "🗑️ Deleting package version ID: $PACKAGE_VERSION_ID..."
10647
107-
SUCCESS=$(echo "$DELETE_RESPONSE" | jq -r '.data.deletePackageVersion.success')
48+
DELETE_STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
49+
-X DELETE \
50+
-H "Authorization: Basic $TOKEN_BASE64" \
51+
-H "Accept: application/vnd.github+json" \
52+
"https://api.github.com/orgs/$ORG/packages/container/$PACKAGE/versions/$PACKAGE_VERSION_ID")
10853
109-
if [[ "$SUCCESS" == "true" ]]; then
110-
echo "✅ Successfully deleted image with tag $TAG"
54+
if [[ "$DELETE_STATUS" -ge 200 && "$DELETE_STATUS" -lt 300 ]]; then
55+
echo "✅ Successfully deleted GHCR tag $TAG (version ID $PACKAGE_VERSION_ID)"
11156
else
112-
echo "❌ Failed to delete image with tag $TAG"
57+
echo "❌ Failed to delete package version. HTTP status: $DELETE_STATUS"
11358
exit 1
11459
fi

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
<feign.version>13.5</feign.version>
6767
<picocli.version>4.7.6</picocli.version>
6868
<flink.version>1.19.2</flink.version>
69-
<postgres.version>42.5.0</postgres.version>
69+
<postgres.version>42.7.5</postgres.version>
7070
<testcontainers.version>1.18.0</testcontainers.version>
7171
</properties>
7272

0 commit comments

Comments
 (0)