Skip to content

Commit 9cc8068

Browse files
committed
Merge branch 'dev' into feat/cache-service-v2-support
2 parents 0766e2b + 9923a2a commit 9cc8068

File tree

6 files changed

+47
-7
lines changed

6 files changed

+47
-7
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,16 @@ jobs:
5353
git config user.name "github-actions[bot]"
5454
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
5555
56-
VERSION=$(git describe --tags --abbrev=0 | sed 's/^v//')
56+
npx bumpp ${{ env[inputs.version] }} -y -r --commit "chore(release): v%s" --no-push
57+
58+
export VERSION=$(git describe --tags --abbrev=0 | sed 's/^v//')
5759
sed -E "s/^appVersion:.+$/appVersion: '$VERSION'/" -i install/kubernetes/github-actions-cache-server/Chart.yaml
5860
git stage install/kubernetes/github-actions-cache-server/Chart.yaml
59-
git commit -nm "chore(release): update helm chart appVersion to $VERSION"
61+
git commit -n --no-edit --amend
62+
git tag -f "v$VERSION"
6063
61-
npx bumpp ${{ env[inputs.version] }} -y -r --commit "chore(release): v%s"
64+
git push origin dev
65+
git push origin --tags
6266
6367
echo "RELEASE_REF=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
6468

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ ENV BUILD_HASH=${BUILD_HASH}
55

66
WORKDIR /app
77

8-
RUN corepack enable
9-
RUN corepack prepare pnpm@latest-9 --activate
8+
RUN npm install -g pnpm@latest-9
109

1110
COPY package.json pnpm-lock.yaml .npmrc ./
1211
COPY patches patches

install/kubernetes/github-actions-cache-server/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ version: 0.1.1
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: '4.0.1'
24+
appVersion: '4.0.3'

lib/db/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ export async function findKeyMatch(
163163
}
164164
}
165165

166+
export async function listEntriesByKey(db: DB, key: string) {
167+
return db.selectFrom('cache_keys').where('key', '=', key).selectAll().execute()
168+
}
169+
166170
export async function updateOrCreateKey(
167171
db: DB,
168172
{

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "github-actions-cache-server",
33
"type": "module",
4-
"version": "4.0.2",
4+
"version": "4.0.3",
55
"private": true,
66
"packageManager": "[email protected]",
77
"engines": {
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { z } from 'zod'
2+
3+
import { auth } from '~/lib/auth'
4+
import { listEntriesByKey, useDB } from '~/lib/db'
5+
6+
const queryParamSchema = z.object({
7+
key: z.string().min(1),
8+
})
9+
10+
export default defineEventHandler({
11+
onRequest: [auth],
12+
handler: async (event) => {
13+
const parsedQuery = queryParamSchema.safeParse(getQuery(event))
14+
if (!parsedQuery.success)
15+
throw createError({
16+
statusCode: 400,
17+
statusMessage: `Invalid query parameters: ${parsedQuery.error.message}`,
18+
})
19+
20+
const { key } = parsedQuery.data
21+
22+
const db = useDB()
23+
const entries = await listEntriesByKey(db, key)
24+
25+
return {
26+
totalCount: entries.length,
27+
artifactCaches: entries.map((entry) => ({
28+
cacheKey: entry.key,
29+
cacheVersion: entry.version,
30+
})),
31+
}
32+
},
33+
})

0 commit comments

Comments
 (0)