Skip to content

Commit 3e3d350

Browse files
committed
chore: improve GitHub report template
1 parent e40a7a7 commit 3e3d350

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

dist/index.js

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

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/reports/github.hbs

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

src/core/action-handler.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ export async function runAction(): Promise<void> {
1111
const inputs = getInputs()
1212
const githubContext = getAllGitHubContext()
1313

14+
// log the github context
15+
console.log(JSON.stringify(githubContext, null, 2))
16+
1417
const report = await prepareReport(inputs, githubContext)
1518
await processIntegrations(inputs.integrationsConfig, report)
1619

src/reports/github.hbs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,17 @@
3030
{{/if}}
3131
{{/if}}
3232
{{#if github.pullRequestNumber}}
33-
{{#if github.pull_request.title}}
34-
![pull-request](https://ctrf.io/assets/github/git-pull-request.svg) #{{github.pullRequestNumber}} {{github.pull_request.title}}
33+
{{#if github.pullRequest.title}}
34+
![pull-request](https://ctrf.io/assets/github/git-pull-request.svg) #{{github.pullRequestNumber}} {{github.pullRequest.title}}
3535
{{else}}
3636
![pull-request](https://ctrf.io/assets/github/git-pull-request.svg) #{{github.pullRequestNumber}}
3737
{{/if}}
38+
{{else}}
39+
{{#if github.context.commits}} ![commit](https://ctrf.io/assets/github/commit.svg) {{github.context.commits.[0].message}}{{#if github.context.commits.[0].id}} ![link](https://ctrf.io/assets/github/link.svg) [{{sliceString github.context.commits.[0].id 0 7}}]({{github.context.commits.[0].url}}){{/if}}{{else}}{{github.commit.message}}{{#if github.commit.hash}} ![link](https://ctrf.io/assets/github/link.svg) [{{github.commit.hash.substring 0 7}}]({{#if github.repository}}{{github.repository}}/commit/{{github.commit.hash}}{{else}}#{{/if}}){{/if}}{{/if}}
3840
{{/if}}
3941
{{#if ctrf.environment.branchName}}
4042
![branch](https://ctrf.io/assets/github/git-branch.svg) {{ctrf.environment.branchName}}
4143
{{/if}}
42-
{{#if github.context.commits}} ![commit](https://ctrf.io/assets/github/commit.svg) {{github.context.commits.[0].message}}{{#if github.context.commits.[0].id}} ![link](https://ctrf.io/assets/github/link.svg) [{{sliceString github.context.commits.[0].id 0 7}}]({{github.context.commits.[0].url}}){{/if}}{{else}}{{github.commit.message}}{{#if github.commit.hash}} ![link](https://ctrf.io/assets/github/link.svg) [{{github.commit.hash.substring 0 7}}]({{#if github.repository}}{{github.repository}}/commit/{{github.commit.hash}}{{else}}#{{/if}}){{/if}}{{/if}}
4344
{{#if ctrf.environment.testEnvironment}}
4445
![test-environment](https://ctrf.io/assets/github/gear.svg) {{ctrf.environment.testEnvironment}}
4546
{{/if}}

0 commit comments

Comments
 (0)