mirror of
https://github.com/renovatebot/renovate.git
synced 2026-11-01 10:09:50 +00:00
4d48fe1399
Since community.ts's config also holds first-party GitHub Actions (e.g. actions/setup-dotnet, actions/setup-java) that need a schema richer than the simple versionedActions map, we can't rely on that map alone to tell "built-in" apart from "community" any more. We can make sure the two generated tables stay accurate as more actions/* entries are added to community.ts's config: the community table now skips any actions/* entry, and the built-in table picks them up alongside the existing versionedActions-based rows. Co-Authored-By: Claude Sonnet 5 <jamie.tanna+claude-code@mend.io>
40 lines
1.3 KiB
TypeScript
40 lines
1.3 KiB
TypeScript
import { codeBlock } from 'common-tags';
|
|
import { communityActions } from '../../../../lib/modules/manager/github-actions/community.ts';
|
|
import { readFile, updateFile } from '../../../utils/index.ts';
|
|
import { replaceContent } from '../../utils.ts';
|
|
import { determineDependencyToUpdate, getWithSchemaFields } from './utils.ts';
|
|
|
|
function generateToolingTable(): string {
|
|
let table = codeBlock`
|
|
| Action | \`with\` input(s) used | Dependency |
|
|
| --- | --- | --- |
|
|
`;
|
|
table += '\n';
|
|
|
|
for (const [name, cfg] of Object.entries(communityActions)) {
|
|
// `actions/*` are GitHub's own first-party Actions, documented separately
|
|
// as "built-in" rather than here as community-maintained.
|
|
if (name.startsWith('actions/')) {
|
|
continue;
|
|
}
|
|
|
|
const withFields = getWithSchemaFields(cfg.withSchema);
|
|
|
|
table += `| [\`${name}\`](https://github.com/${name}) | \`${withFields.join('`, `')}\` | ${determineDependencyToUpdate(cfg)} |\n`;
|
|
}
|
|
|
|
return table;
|
|
}
|
|
|
|
export async function generateManagerGithubActionsCommunity(
|
|
dist: string,
|
|
): Promise<void> {
|
|
const indexFileName = `${dist}/modules/manager/github-actions/index.md`;
|
|
let indexContent = await readFile(indexFileName);
|
|
indexContent = replaceContent(indexContent, generateToolingTable());
|
|
await updateFile(
|
|
`${dist}/modules/manager/github-actions/index.md`,
|
|
indexContent,
|
|
);
|
|
}
|