Skip to content

Commit 3f2e7a0

Browse files
no message
1 parent dc04cee commit 3f2e7a0

File tree

1 file changed

+3
-35
lines changed

1 file changed

+3
-35
lines changed

.github/workflows/coverage.yml

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,21 @@ on:
44
workflow_run:
55
workflows: ["Integration Tests", "Unit Tests"]
66
types: [completed]
7-
# Also allow manual triggering for debugging
87
workflow_dispatch:
98

109
jobs:
1110
finalize:
1211
runs-on: ubuntu-latest
1312
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
14-
# Needed for listWorkflowRunsForRepo and safe defaults for token scope
15-
permissions:
16-
actions: read
17-
contents: read
18-
statuses: write
19-
# Prevent multiple concurrent finalizers for the same commit
20-
concurrency:
21-
group: coverage-${{ github.event.workflow_run.head_sha || github.sha }}
22-
cancel-in-progress: true
2313
steps:
2414
- id: check
2515
uses: actions/github-script@v7
2616
with:
2717
script: |
28-
// For manual dispatch, use the current SHA, otherwise use the triggering workflow's SHA
29-
const targetSha = context.payload.workflow_run?.head_sha || context.sha;
30-
3118
const workflows = await github.rest.actions.listWorkflowRunsForRepo({
3219
owner: context.repo.owner,
3320
repo: context.repo.repo,
34-
head_sha: targetSha,
21+
head_sha: context.payload.workflow_run?.head_sha || context.sha,
3522
status: 'completed',
3623
per_page: 100
3724
});
@@ -42,32 +29,13 @@ jobs:
4229
)
4330
);
4431
45-
// Debug information
46-
core.info(`Found ${workflows.data.workflow_runs.length} workflow runs for SHA ${targetSha}`);
47-
core.info(`Looking for workflows: Integration Tests, Unit Tests`);
48-
49-
workflows.data.workflow_runs.forEach(run => {
50-
core.info(`- ${run.name}: ${run.conclusion} (${run.status}) - ID: ${run.id}`);
51-
});
52-
53-
// Check each required workflow specifically
54-
const integrationTests = workflows.data.workflow_runs.find(run => run.name === 'Integration Tests');
55-
const unitTests = workflows.data.workflow_runs.find(run => run.name === 'Unit Tests');
56-
57-
core.info(`Integration Tests found: ${integrationTests ? 'YES' : 'NO'} - ${integrationTests?.conclusion || 'N/A'}`);
58-
core.info(`Unit Tests found: ${unitTests ? 'YES' : 'NO'} - ${unitTests?.conclusion || 'N/A'}`);
59-
6032
core.info(bothComplete ? 'Both workflows completed successfully.' : 'Waiting for other workflow to complete.');
6133
core.setOutput('ready', String(bothComplete));
6234
6335
- if: ${{ steps.check.outputs.ready == 'true' }}
36+
name: Finalize coverage report
6437
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b
6538
with:
6639
github-token: ${{ secrets.GITHUB_TOKEN }}
6740
parallel-finished: true
68-
carryforward: "Integration,Unit"
69-
# Pass the original commit SHA and PR context to maintain consistency
70-
git-commit: ${{ github.event.workflow_run.head_sha || github.sha }}
71-
git-branch: ${{ github.event.workflow_run.head_branch || github.ref_name }}
72-
service-number: ${{ github.event.workflow_run.id || github.run_id }}
73-
pull-request: ${{ github.event.workflow_run.pull_requests[0].number || github.event.pull_request.number || '' }}
41+
carryforward: "Unit,Integration"

0 commit comments

Comments
 (0)