Skip to content

Commit b1598f0

Browse files
committed
magic header
1 parent 42e93ad commit b1598f0

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

.github/workflows/size.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ name: Size
3030

3131
on:
3232
push:
33-
branches:
34-
- 'main'
33+
branches-ignore:
34+
- 'dependabot/**'
3535
pull_request:
3636
branches:
3737
- 'main'
@@ -85,7 +85,9 @@ jobs:
8585
repo: context.repo.repo,
8686
});
8787
88-
const comment = response.data.find(comment => comment.body.includes('# Size Report of **OpenThread**'))
88+
const kMagicHeader = '<!-- Size Report of **OpenThread** -->'
89+
90+
const comment = response.data.find(comment => comment.body.startsWith(kMagicHeader))
8991
9092
if (comment) {
9193
params.comment_id = comment.id;

script/check-size

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ readonly OT_REPORT_FILE_TABLE
4444
OT_REPORT_FILE_PR="${OT_TMP_DIR}/report_pr"
4545
readonly OT_REPORT_FILE_TABLE
4646

47-
PR_NUMBER="$([[ $GITHUB_REF_NAME =~ ([0-9]+)/merge ]] && echo "${BASH_REMATCH[1]}")"
47+
if [[ $GITHUB_REF_NAME =~ ([0-9]+)/merge ]]; then
48+
PR_NUMBER="${BASH_REMATCH[1]}"
49+
else
50+
PR_NUMBER=
51+
fi
4852

4953
setup_arm_gcc_7()
5054
{
@@ -169,9 +173,9 @@ generate_table_header()
169173
} >>"${OT_REPORT_FILE_TABLE}"
170174

171175
{
172-
printf "# Size Report of **OpenThread**\n"
176+
printf "<!-- Size Report of **OpenThread** -->\n"
173177
if [[ -n $PR_NUMBER ]]; then
174-
printf "> Merging #${PR_NUMBER} into ${GITHUB_BASE_REF}\n\n"
178+
printf "> Merging #%s into %s\n\n" "${PR_NUMBER}" "${GITHUB_BASE_REF}"
175179
fi
176180
printf "| name | branch | text | data | bss | total |\n"
177181
printf "| :----: | :------: | -----: | ----: | ---: | ----: |\n"

0 commit comments

Comments
 (0)