Content-Length: 313789 | pFad | http://github.com/micropython/micropython/commit/96c23432f6ef448fdcccdfa6a442d64d7ed06277

E2 github/workflows: Fix code size comment workflow for non-PR. · micropython/micropython@96c2343 · GitHub
Skip to content

Commit 96c2343

Browse files
dlechdpgeorge
authored andcommitted
github/workflows: Fix code size comment workflow for non-PR.
This fixes the case for the code size comment action where there is no matching artifact. Apparently, the result of the github-script action was not treating `false` as a boolean value. To fix the problem we change the result to use string. Also add some logging to make the step a bit less cryptic. Signed-off-by: David Lechner <david@pybricks.com>
1 parent 3ecbaf1 commit 96c2343

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Diff for: .github/workflows/code_size_comment.yml

+11-4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
id: download-artifact
1414
uses: actions/github-script@v6
1515
with:
16+
result-encoding: string
1617
script: |
1718
const fs = require('fs');
1819
@@ -27,7 +28,10 @@ jobs:
2728
});
2829
2930
if (matchArtifact.length === 0) {
30-
return false;
31+
console.log('no matching artifact found');
32+
console.log('result: "skip"');
33+
34+
return 'skip';
3135
}
3236
3337
const download = await github.rest.actions.downloadArtifact({
@@ -39,12 +43,15 @@ jobs:
3943
4044
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/code-size-report.zip`, Buffer.from(download.data));
4145
42-
return true;
46+
console.log('artifact downloaded to `code-size-report.zip`');
47+
console.log('result: "ok"');
48+
49+
return 'ok';
4350
- name: 'Unzip artifact'
44-
if: steps.download-artifact.outputs.result
51+
if: steps.download-artifact.outputs.result == 'ok'
4552
run: unzip code-size-report.zip
4653
- name: Post comment to pull request
47-
if: steps.download-artifact.outputs.result
54+
if: steps.download-artifact.outputs.result == 'ok'
4855
uses: actions/github-script@v6
4956
with:
5057
github-token: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/micropython/micropython/commit/96c23432f6ef448fdcccdfa6a442d64d7ed06277

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy