@@ -14,22 +14,30 @@ jobs:
14
14
- name : ' ↓ Download code size report'
15
15
uses : actions/download-artifact@v4
16
16
with :
17
- name : " code-size-report"
17
+ name : code-size-report
18
18
run-id : ${{ github.event.workflow_run.id }}
19
19
github-token : ${{ github.token }}
20
20
21
- - name : ' 📝 Check Report '
21
+ - name : ' 📝 Check report '
22
22
run : |
23
+ # List the contents of the workspace to verify the file exists
23
24
ls -1 -R ${GITHUB_WORKSPACE}
24
- CODE_SIZE_REPORT=code-size-report.md
25
- cat ${GITHUB_WORKSPACE}/${CODE_SIZE_REPORT}
26
-
27
- PR_NUMBER=$(jq -r '.workflow_run.pull_requests[0].number' < "$GITHUB_EVENT_PATH")
25
+
26
+ # Get the filename matching the pattern *.md (assuming there is only one such file)
27
+ CODE_SIZE_REPORT=$(ls ${GITHUB_WORKSPACE}/*.md)
28
+ echo "Code Size Report : ${CODE_SIZE_REPORT}"
29
+
30
+ # Extract the PR number from the filename
31
+ # Assuming the filename format is <pr_number>.md
32
+ PR_NUMBER=$(basename "${CODE_SIZE_REPORT}" .md)
28
33
echo "Pull Request Number : $PR_NUMBER"
29
-
30
- if [ -s ${GITHUB_WORKSPACE}/${CODE_SIZE_REPORT} ]; then
34
+
35
+ # Check if the report file is not empty
36
+ if [ -s "${CODE_SIZE_REPORT}" ]; then
31
37
echo "pr_number=${PR_NUMBER}" >> $GITHUB_OUTPUT
32
38
echo "code_size_report=${CODE_SIZE_REPORT}" >> $GITHUB_OUTPUT
39
+ else
40
+ echo "The report file is empty."
33
41
fi
34
42
35
43
- name : ' 📝 Post report'
0 commit comments