Skip to content

Commit

Permalink
🚧 Get rid of typescript #1770
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandolucchesi committed Aug 7, 2023
1 parent 55e6b44 commit cc15d8a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/ghcr-cleanup_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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())
Expand Down

0 comments on commit cc15d8a

Please sign in to comment.