Skip to content

Commit 658e34b

Browse files
authored
Merge pull request #5 from iabdalkader/update_workflows
update workflows
2 parents 7773d02 + def311e commit 658e34b

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

.github/workflows/code-size-report.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,30 @@ jobs:
1414
- name: '↓ Download code size report'
1515
uses: actions/download-artifact@v4
1616
with:
17-
name: "code-size-report"
17+
name: code-size-report
1818
run-id: ${{ github.event.workflow_run.id }}
1919
github-token: ${{ github.token }}
2020

21-
- name: '📝 Check Report'
21+
- name: '📝 Check report'
2222
run: |
23+
# List the contents of the workspace to verify the file exists
2324
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)
2833
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
3137
echo "pr_number=${PR_NUMBER}" >> $GITHUB_OUTPUT
3238
echo "code_size_report=${CODE_SIZE_REPORT}" >> $GITHUB_OUTPUT
39+
else
40+
echo "The report file is empty."
3341
fi
3442

3543
- name: '📝 Post report'

.github/workflows/firmware.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111
- name: '📝 Generate report'
1212
id: generate_report
1313
run: |
14-
CODE_SIZE_REPORT=code-size-report.md
14+
CODE_SIZE_REPORT=${{ github.event.pull_request.number }}.md
1515
echo "Test" > ${GITHUB_WORKSPACE}/${CODE_SIZE_REPORT}
16-
if [ -s ${GITHUB_WORKSPACE}/${CODE_SIZE_REPORT} ]; then
16+
if [ -s ${GITHUB_WORKSPACE}/${CODE_SIZE_REPORT}/report.md ]; then
1717
echo "code_size_report=${CODE_SIZE_REPORT}" >> $GITHUB_OUTPUT
1818
fi
1919

0 commit comments

Comments
 (0)