Skip to content

Generated Files

Hollywood writes generated files only through writeGeneratedFiles.

await writeGeneratedFiles(files, { outputDir: process.cwd() });

outputDir is the filesystem root for the write. A generated path that escapes that directory is rejected.

Every generated text file starts with an @generated by Hollywood comment. Callers may pass an explicit timestamp, but CLI generation omits timestamps so re-running it is idempotent. Checked-in JavaScript action bundles also get a generated banner from .github/actions/build.mjs; package bundles get one from npm run build.

File states

Each write reports one of three states:

State Meaning
created The file did not exist and was written.
updated The file existed and content changed.
unchanged The file existed with identical content.

These states make generation script output predictable. A check mode can fail if any file would be created or updated.

Action file

.github/actions/<action-directory>/action.yml

This file is GitHub Actions metadata. Hollywood validates it before writing. If the source path already lives under .github/actions/<action-directory>/src, Hollywood keeps the generated files in that action directory. Other action sources use action.name as their generated directory.

Entrypoint file

.github/actions/<action-directory>/src/index.ts

This file adapts the script to GitHub's official action toolkit:

void runGitHubAction(action);

The entrypoint still needs bundling into:

.github/actions/<action-directory>/dist/index.js

Workflow file

.github/workflows/<flattened-source-path>.yml

The source tree can be nested:

gha/containers/release.ts

The GitHub workflow output is flat:

.github/workflows/containers-release.yml

That satisfies GitHub's directory shape without forcing humans to keep every workflow source file in one directory.