diff --git a/packages/core/src/__snapshots__/workflow-generator.test.ts.snap b/packages/core/src/__snapshots__/workflow-generator.test.ts.snap index 9625f72..83be54b 100644 --- a/packages/core/src/__snapshots__/workflow-generator.test.ts.snap +++ b/packages/core/src/__snapshots__/workflow-generator.test.ts.snap @@ -26,3 +26,19 @@ jobs: run: bun test " `; + +exports[`workflow-generator > generateWorkflowYaml > should render reusable workflow call job deterministically 1`] = ` +"# This file is autogenerated by DotGitHub. Do not edit manually. +name: Reusable Caller +on: + pull_request: + branches: + - main +jobs: + lint: + uses: ./.github/workflows/lint.yml + with: + node: "22" + secrets: inherit +" +`; diff --git a/packages/core/src/workflow-generator.test.ts b/packages/core/src/workflow-generator.test.ts index 87c3637..deec64c 100644 --- a/packages/core/src/workflow-generator.test.ts +++ b/packages/core/src/workflow-generator.test.ts @@ -220,6 +220,28 @@ describe('workflow-generator', () => { expect(generateWorkflowYaml(workflow)).toMatchSnapshot(); }); + + it('should render reusable workflow call job deterministically', () => { + const workflow: GitHubWorkflow = { + name: 'Reusable Caller', + on: { + pull_request: { + branches: ['main'], + }, + }, + jobs: { + lint: { + uses: './.github/workflows/lint.yml', + with: { + node: '22', + }, + secrets: 'inherit', + } as unknown as GitHubJob, + }, + }; + + expect(generateWorkflowYaml(workflow)).toMatchSnapshot(); + }); }); describe('createWorkflow', () => {