Skip to content

Commit c7aa769

Browse files
committed
Try
1 parent 71b9656 commit c7aa769

File tree

9 files changed

+41
-11
lines changed

9 files changed

+41
-11
lines changed

.github/actions/reports-group/attach-check-run-to-triggering-workflow-action/dist/index.js

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

.github/actions/reports-group/attach-check-run-to-triggering-workflow-action/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.

.github/actions/reports-group/attach-check-run-to-triggering-workflow-action/index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,25 @@ async function run() {
3131
conclusion: undefinedIfEmpty(checkConclusion),
3232
started_at: undefinedIfEmpty(startedAt),
3333
completed_at: undefinedIfEmpty(completedAt),
34-
owner: repoOwner,
35-
repo: repoName
3634
};
3735
if (!isEmpty(outputTitle) || !isEmpty(outputSummary)) {
3836
res.output = {title: undefinedIfEmpty(outputTitle), summary: undefinedIfEmpty(outputSummary)};
3937
}
38+
39+
return res;
4040
}
4141
);
4242
core.debug('API params=' + JSON.stringify(requestParams));
4343

4444
const apiResponse = await core.group('Call API', async () => {
4545
const octokit = github.getOctokit(githubToken);
4646

47-
return octokit.request('POST /repos/{owner}/{repo}/check-runs', requestParams);
47+
// @TODO Move back to `octokit.rest.checks.create()`
48+
const res = await octokit.request('POST /repos/' + repoOwner+ '/' + repoName + '/check-runs', requestParams);
49+
50+
core.info('TMP DEBUG0 ' + JSON.stringify(res));
51+
52+
return res;
4853
});
4954
core.info('TMP DEBUG' + JSON.stringify(apiResponse));
5055

.github/actions/reports-group/codacy-uploader/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ runs:
4747
})
4848
);
4949
50-
# @TODO move reports-group/load-metadata action to a dedicated repo and remove the checkout
50+
# @TODO move actions to a dedicated repo and remove the checkout
5151
- uses: actions/checkout@v4
5252
with:
5353
path: custom-action-repo

.github/actions/reports-group/codecov-uploader/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ runs:
9191
})
9292
);
9393
94-
# @TODO move reports-group/load-metadata action to a dedicated repo and remove the checkout
94+
# @TODO move actions to a dedicated repo and remove the checkout
9595
- uses: actions/checkout@v4
9696
with:
9797
path: custom-action-repo

.github/workflows/CI.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@ jobs:
242242
uses: ./.github/workflows/codacy-upload-from-artifacts.yml
243243
with:
244244
artifacts-pattern: coverage-groups-*
245+
permissions:
246+
contents: read
247+
checks: write # For the check run creation !
245248
secrets:
246249
PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
247250

@@ -251,6 +254,9 @@ jobs:
251254
uses: ./.github/workflows/codecov-upload-from-artifacts.yml
252255
with:
253256
artifacts-pattern: coverage-groups-*
257+
permissions:
258+
contents: read
259+
checks: write # For the check run creation !
254260
secrets:
255261
TOKEN: ${{ secrets.CODECOV_TOKEN }}
256262

.github/workflows/codacy-upload-from-artifacts.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ jobs:
3636
outputs:
3737
groups: ${{ steps.upload.outputs.groups }}
3838
reports: ${{ steps.upload.outputs.reports }}
39+
permissions:
40+
contents: read
41+
checks: write # For the check run creation !
3942
steps:
4043
# @TODO move actions to a dedicated repo and remove the checkout
4144
- uses: actions/checkout@v4

.github/workflows/codecov-upload-from-artifacts.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ jobs:
2828
outputs:
2929
matrix: ${{ steps.build-matrix.outputs.matrix }}
3030
list-for-output: ${{ steps.find-groups.outputs.list }}
31+
permissions:
32+
contents: read
33+
checks: write # For the check run creation !
3134
steps:
32-
# @TODO move reports-group/load-metadata action to a dedicated repo and remove the checkout
35+
# @TODO move actions to a dedicated repo and remove the checkout
3336
- uses: actions/checkout@v4
3437
with:
3538
path: custom-action-repo
@@ -104,6 +107,9 @@ jobs:
104107
fail-fast: true
105108
max-parallel: 4
106109
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}
110+
permissions:
111+
contents: read
112+
checks: write # For the check run creation !
107113
steps:
108114
- name: DEBUG matrix
109115
run: echo 'matrix='"'"'${{ toJson(matrix) }}'"'"
@@ -113,7 +119,12 @@ jobs:
113119
- name: Checkout Repository
114120
uses: actions/checkout@v4
115121

116-
- uses: ./.github/actions/reports-group/attach-check-run-to-triggering-workflow-action
122+
# @TODO move actions to a dedicated repo and remove the checkout
123+
- uses: actions/checkout@v4
124+
with:
125+
path: custom-action-repo
126+
127+
- uses: ./custom-action-repo/.github/actions/reports-group/attach-check-run-to-triggering-workflow-action
117128
with:
118129
name: "${{ github.workflow }} (${{ github.event.workflow.name}}) / Codecov / ${{ matrix.artifact}} - ${{ matrix.path }}"
119130
commit-sha: "${{ ('workflow_run' == github.event_name && ('pull_request' == github.event.workflow_run.event || 'push' == github.event.workflow_run.event) && github.event.workflow_run.head_sha) || ('pull_request' == github.event_name && github.event.pull_request.head.sha) || ('push' == github.event_name && github.sha) || null }}"
@@ -133,10 +144,9 @@ jobs:
133144
ls -ail job-artifact/*
134145
ls -ail job-artifact/*/*
135146
136-
# @TODO move reports-group/codecov-uploader action to a dedicated repo and remove the checkout
137147
- name: Upload reports
138148
id: upload
139-
uses: ./.github/actions/reports-group/codecov-uploader
149+
uses: ./custom-action-repo/.github/actions/reports-group/codecov-uploader
140150
with:
141151
path: job-artifact/${{ matrix.path }}
142152
token: ${{ secrets.TOKEN }}

.github/workflows/coverage-upload.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ jobs:
1212
with:
1313
artifacts-pattern: coverage-groups-*
1414
run-id: ${{ github.event.workflow_run.id }}
15+
permissions:
16+
contents: read
17+
checks: write # For the check run creation !
1518
secrets:
1619
PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
1720

@@ -22,6 +25,9 @@ jobs:
2225
with:
2326
artifacts-pattern: coverage-groups-*
2427
run-id: ${{ github.event.workflow_run.id }}
28+
permissions:
29+
contents: read
30+
checks: write # For the check run creation !
2531
secrets:
2632
TOKEN: ${{ secrets.CODECOV_TOKEN }}
2733

0 commit comments

Comments
 (0)