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.
  • Loading branch information
liushilongbuaa committed Mar 7, 2023
1 parent 506f372 commit 4773b44
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/automerge_scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
automerge_scan:
if: github.repository_owner == 'sonic-net'
#if: github.repository_owner == 'sonic-net'
runs-on: ubuntu-latest
steps:
- name: Debug
Expand Down Expand Up @@ -38,10 +38,13 @@ 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
if [[ "$state" == "SUCCESS" ]];then
if echo $name | grep Semgrep;then
continue
elif [[ "$state" == "SUCCESS" ]];then
# check pass
continue
elif [[ "$conclusion" == "SUCCESS" ]] || [[ "$conclusion" == "NEUTRAL" ]];then
Expand All @@ -50,6 +53,9 @@ jobs:
else
echo "$url Check failed!!!"
echo $check | jq
if [[ $created_at > $(date --date "1 day ago" -u +"%FT%TZ") ]];then
gh pr comment $url -b "/azp run Azure.sonic-buildimage"
fi
continue 2
fi
done
Expand Down

0 comments on commit 4773b44

Please sign in to comment.