diff --git a/.github/workflows/full-info.yml b/.github/workflows/full-info.yml index 27c2d49..9ac88db 100644 --- a/.github/workflows/full-info.yml +++ b/.github/workflows/full-info.yml @@ -9,6 +9,9 @@ jobs: generate: runs-on: ubuntu-24.04 timeout-minutes: 5 + permissions: + contents: write + steps: - name: Checkout uses: actions/checkout@v4 @@ -19,7 +22,7 @@ jobs: node-version: '22' - name: Install dependencies - run: npm install tsx + run: npm install tsx @actions/core @actions/github - name: Generate run: npx tsx .github/workflows/scripts/extract-metadata.ts diff --git a/.github/workflows/scripts/extract-metadata.ts b/.github/workflows/scripts/extract-metadata.ts index b6ef86b..64ecac6 100644 --- a/.github/workflows/scripts/extract-metadata.ts +++ b/.github/workflows/scripts/extract-metadata.ts @@ -1,6 +1,7 @@ import fs from 'fs/promises'; import path from 'path'; import { pathToFileURL } from 'url'; +import * as github from '@actions/github'; type Info = Partial<{ name: string; @@ -28,7 +29,7 @@ type Info = Partial<{ type Entity = { info: Info; - logo: string; + logo?: string; }; enum DIRECTORIES { @@ -42,8 +43,10 @@ enum DIRECTORIES { type Template = Record>; async function grabEntitiesInfo(globalDirs: DIRECTORIES[]) { + const repoPath = [github.context.repo.owner, github.context.repo.repo].join('/'); const result = Object.values(DIRECTORIES).reduce