Skip to content

Commit

Permalink
maybe this?
Browse files Browse the repository at this point in the history
  • Loading branch information
mrgrain committed Oct 24, 2023
1 parent da22855 commit 3b07854
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/build.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 14 additions & 8 deletions projenrc/diff-db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,24 +126,30 @@ export class DiffDb extends pj.Component {
},
{
name: 'Diff databases',
run: `${this.path(this.importers.outdir + '/bin/diff-db')} base/db.json.gz head/db.json.gz > DIFF`,
id: 'diff-db',
continueOnError: true,
run: `${this.path(
this.importers.outdir + '/bin/diff-db',
)} base/db.json.gz head/db.json.gz > DIFF || echo "diff-result=true" >> $GITHUB_OUTPUT`,
},
{
id: 'diff-db',
name: 'Create PR.md',
if: 'steps.diff-db.outputs.diff-result',
run: [
'echo "diff=$(cat DIFF)" >> $GITHUB_OUTPUT',
'echo "\\`\\`\\`\\n$(cat DIFF)\\n\\`\\`\\`\\" >> $GITHUB_STEP_SUMMARY',
"echo 'Model database diff introduced between base and head branch:\n\n' >> PR.md",
"echo '```\\n' >> PR.md",
'cat DIFF >> PR.md',
"echo '\\n```\\n' >> PR.md",
// 'echo "(cat PR.md)" >> $GITHUB_STEP_SUMMARY',
].join('\n'),
},

{
name: 'Comment diff',
if: '${{ steps.diff-db.outputs.diff }}',
if: 'steps.diff-db.outputs.diff-result',
uses: 'thollander/actions-comment-pull-request@v2',
with: {
comment_tag: 'diff-db',
message:
'Model database diff introduced between base and head branch:\n```\n${{ steps.diff-db.outputs.diff }}\n```\n',
filePath: 'PR.md',
},
},
],
Expand Down

0 comments on commit 3b07854

Please sign in to comment.