Skip to content

Commit 1b65502

Browse files
v4.0.3 (#97)
Co-authored-by: Louis Haftmann <30736553+LouisHaftmann@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 6d95615 commit 1b65502

File tree

6 files changed

+46
-9
lines changed

6 files changed

+46
-9
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,14 @@ jobs:
5555
5656
npx bumpp ${{ env[inputs.version] }} -y -r --commit "chore(release): v%s"
5757
58-
VERSION=$(git describe --tags --abbrev=0 | sed 's/^v//')
59-
sed -E "s/^appVersion:.+$/appVersion: '$VERSION'/" -i install/kubernetes/github-actions-cache-server/Chart.yaml
60-
git stage install/kubernetes/github-actions-cache-server/Chart.yaml
61-
git commit --amend --no-edit
62-
6358
echo "RELEASE_REF=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
6459
60+
- name: ⬆️ Bump Helm chart app version
61+
run: |
62+
VERSION=$(git describe --tags --abbrev=0 | sed 's/^v//') sed -E "s/^appVersion:.+$/appVersion: '$VERSION'/" -i install/kubernetes/github-actions-cache-server/Chart.yaml
63+
git stage install/kubernetes/github-actions-cache-server/Chart.yaml
64+
git commit -nm "chore(release): update helm chart appVersion to $VERSION"
65+
6566
- name: 📥 Create release PR
6667
id: create-release-pr
6768
run: |

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: ''

lib/db/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ export async function findKeyMatch(
151151
}
152152
}
153153

154+
export async function listEntriesByKey(db: DB, key: string) {
155+
return db.selectFrom('cache_keys').where('key', '=', key).selectAll().execute()
156+
}
157+
154158
export async function updateOrCreateKey(
155159
db: DB,
156160
{

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": "pnpm@9.1.3",
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)