Skip to content

Commit 7c10fc6

Browse files
committed
Fix Actions workflow - add a dedicated 'Sync Astro types' step to build-and-test.yml so CI runs npm run sync before TypeScript checks, typed rss.xml.ts by importing CollectionEntry and annotating the article parameter in the RSS item map to satisfy noImplicitAny
1 parent edb4054 commit 7c10fc6

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/build-and-test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ jobs:
5050
- name: Install dependencies
5151
run: npm ci --legacy-peer-deps
5252

53+
- name: Sync Astro types
54+
run: npm run sync
55+
5356
- name: Run TypeScript check
5457
run: npm run check
5558

src/pages/rss.xml.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import rss from '@astrojs/rss'
22
import { getCollection } from 'astro:content'
33
import type { APIContext } from 'astro'
4+
import type { CollectionEntry } from 'astro:content'
45

56
export async function GET(context: APIContext) {
67
const articles = await getCollection('articles')
@@ -9,7 +10,7 @@ export async function GET(context: APIContext) {
910
description:
1011
'Webstack Builders is a solo software development agency specializing in platform engineering.',
1112
site: context.site ?? 'https://webstackbuilders.com',
12-
items: articles.map(article => ({
13+
items: articles.map((article: CollectionEntry<'articles'>) => ({
1314
title: article.data.title,
1415
pubDate: article.data.publishDate,
1516
description: article.data.description,

0 commit comments

Comments
 (0)