Skip to content

Commit

Permalink
feat: add filter for workflow name
Browse files Browse the repository at this point in the history
  • Loading branch information
Ma11hewThomas committed Oct 3, 2024
1 parent 5fb9e74 commit 3344a26
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/historical.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export async function generateHistoricSummary(
const limitedSummaryRows = summaryRows.slice(0, rows)

const summaryTable = `
| Build 🏗️ | Result 🧪 | Tests 📝 | Passed ✅ | Failed ❌ | Skipped ⏭️ | Pending ⏳ | Other ❓ | Flaky 🍂 | Duration ⏱️ |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
${limitedSummaryRows.join('\n')}
Expand Down Expand Up @@ -105,8 +106,9 @@ async function fetchPreviousRuns(
run.pull_requests.some(
(pr: any) => pr.number === githubProperties.pullRequestNumber
)
const isWorkflowNameMatch = run.name === githubProperties.workflowName;

if (isBranchMatch || isPRMatch) {
if ((isBranchMatch || isPRMatch) && isWorkflowNameMatch) {
console.log(
`Match found for workflow ${run.name} with run number ${run.run_number}`
)
Expand All @@ -116,7 +118,7 @@ async function fetchPreviousRuns(
)
}

return isBranchMatch || isPRMatch
return (isBranchMatch || isPRMatch) && isWorkflowNameMatch;
}
)

Expand Down
2 changes: 2 additions & 0 deletions types/ctrf.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface CtrfTest {
suite?: string
message?: string
trace?: string
line?: number
ai?: string
rawStatus?: string
tags?: string[]
Expand All @@ -49,6 +50,7 @@ export interface CtrfTest {
}

export interface CtrfEnvironment {
reportName?: string
appName?: string
appVersion?: string
osPlatform?: string
Expand Down

0 comments on commit 3344a26

Please sign in to comment.