diff --git a/.github/workflows/ghcr-cleanup_v2.yaml b/.github/workflows/ghcr-cleanup_v2.yaml index 4efedf52d..637686a3b 100644 --- a/.github/workflows/ghcr-cleanup_v2.yaml +++ b/.github/workflows/ghcr-cleanup_v2.yaml @@ -29,12 +29,7 @@ jobs: node-version: '14' - name: Install dependencies - run: | - npm install -g typescript - npm install node-fetch @types/node - - - name: Compile TypeScript - run: npx tsc '.github/workflows/ghcr_cleanup/cleanup.ts' + run: npm install node-fetch - name: Make API request and process data run: node '.github/workflows/ghcr_cleanup/cleanup.js' diff --git a/.github/workflows/ghcr_cleanup/cleanup.ts b/.github/workflows/ghcr_cleanup/cleanup.js similarity index 78% rename from .github/workflows/ghcr_cleanup/cleanup.ts rename to .github/workflows/ghcr_cleanup/cleanup.js index 4ef892cc9..d6d97db83 100644 --- a/.github/workflows/ghcr_cleanup/cleanup.ts +++ b/.github/workflows/ghcr_cleanup/cleanup.js @@ -1,14 +1,4 @@ -// @ts-ignore -const fetch = require('node-fetch') - -interface Data { - activeFrom: string - components: { - name: string - type: string - image: string - }[] -} +import fetch from 'node-fetch' // @ts-ignore const bearerToken = process.env.APP_SERVICE_ACCOUNT_TOKEN @@ -24,7 +14,7 @@ async function cleanup() { }) const rawData = await response.json() - const data: Data[] = Array.isArray(rawData) ? rawData : [] + const data = Array.isArray(rawData) ? rawData : [] // Sort by activeFrom data.sort((a, b) => new Date(b.activeFrom).getTime() - new Date(a.activeFrom).getTime())