Skip to content

Commit

Permalink
[action] Update AutoMergeScan action to ignore Semgrep and rerun fail…
Browse files Browse the repository at this point in the history
…ed job. (sonic-net#14118)

Why I did it
Semgrep check has some issues. Ignore it.
check automerge label.
Ignore Azure.sonic-buildimage sub test jobs. Only check final result.
How I did it
  • Loading branch information
liushilongbuaa committed Mar 10, 2023
1 parent 30528f2 commit 03c02e3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/automerge_scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ jobs:
echo PR: $(($i+1))/$count, URL: $url, createdAt: $created_at, now: $(date -u +"%FT%TZ")
[[ "$url" == "" ]] && continue
[[ $created_at > $(date --date "1 hour ago" -u +"%FT%TZ") ]] && continue
# only check automerge PR.
cat prs.log | jq -r ".[$i].labels[].name" | grep automerge || continue
checks=$(cat prs.log | jq ".[$i].statusCheckRollup")
checks_count=$(echo $checks | jq 'length')
echo Checks count: $checks_count
Expand All @@ -38,9 +41,14 @@ jobs:
check=$(echo $checks | jq ".[$j]")
state=$(echo $check | jq -r '.state')
conclusion=$(echo $check | jq -r '.conclusion')
name=$(echo $check | jq -r '.name')
# EasyCLA success flag: state=SUCCESS
# Others success flag: conclusion in SUCCESS,NEUTRAL
# Ignore Azure.sonic-buildimage stage check result. It may be set continueOnError
echo "$name" | grep "Azure.sonic-buildimage (" && continue
# Ignore Semgrep, it has issues.
[[ "$name" == "Semgrep" ]] && continue
if [[ "$state" == "SUCCESS" ]];then
# check pass
continue
Expand Down

0 comments on commit 03c02e3

Please sign in to comment.