Skip to content

Commit f374e12

Browse files
authored
chore(gh): update workflow (#1195)
1 parent 90311b5 commit f374e12

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

.github/workflows/code-generation.yml

Lines changed: 10 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

projenrc/github-workflows.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,12 @@ export function buildCodeGenerationWorkflow(project: AwsCdkConstructLibrary) {
503503
id: CREATE_PATCH_STEP_ID,
504504
run: [
505505
'git add .',
506-
'git diff --staged --patch --exit-code > .repo.patch || echo "patch_created=true" >> $GITHUB_OUTPUT',
506+
'if git diff --staged --quiet; then',
507+
' echo "No changes detected"',
508+
'else',
509+
' git diff --staged --patch > repo.patch',
510+
' echo "patch_created=true" >> $GITHUB_OUTPUT',
511+
'fi',
507512
].join('\n'),
508513
shell: 'bash',
509514
},
@@ -512,8 +517,8 @@ export function buildCodeGenerationWorkflow(project: AwsCdkConstructLibrary) {
512517
if: `steps.${CREATE_PATCH_STEP_ID}.outputs.${PATCH_CREATED_OUTPUT}`,
513518
uses: 'actions/upload-artifact@v4.6.2',
514519
with: {
515-
name: '.repo.patch',
516-
path: '.repo.patch',
520+
name: 'repo.patch',
521+
path: 'repo.patch',
517522
overwrite: true,
518523
},
519524
},
@@ -541,13 +546,13 @@ export function buildCodeGenerationWorkflow(project: AwsCdkConstructLibrary) {
541546
name: 'Download patch',
542547
uses: 'actions/download-artifact@v5',
543548
with: {
544-
name: '.repo.patch',
549+
name: 'repo.patch',
545550
path: '${{ runner.temp }}',
546551
},
547552
},
548553
{
549554
name: 'Apply patch',
550-
run: '[ -s ${{ runner.temp }}/.repo.patch ] && git apply ${{ runner.temp }}/.repo.patch || echo "Empty patch. Skipping."',
555+
run: '[ -s ${{ runner.temp }}/repo.patch ] && git apply ${{ runner.temp }}/repo.patch || echo "Empty patch. Skipping."',
551556
},
552557
{
553558
name: 'Set git identity',

0 commit comments

Comments
 (0)