* Break on success when alert already has decision (#997) Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
This commit is contained in:
parent
079172568a
commit
0ccc69696b
10
.github/workflows/ci_hubtest.yml
vendored
10
.github/workflows/ci_hubtest.yml
vendored
|
@ -12,8 +12,6 @@ jobs:
|
||||||
hubtest:
|
hubtest:
|
||||||
name: Hub tests
|
name: Hub tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
|
||||||
PUSH_COVERAGE: ${{ github.ref == 'refs/heads/master' }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go 1.16
|
- name: Set up Go 1.16
|
||||||
uses: actions/setup-go@v1
|
uses: actions/setup-go@v1
|
||||||
|
@ -54,7 +52,7 @@ jobs:
|
||||||
echo "SCENARIO_BADGE_COLOR=$(if [ $SCENARIOS_COV_NUMBER -lt '70' ]; then echo 'red'; else echo 'green'; fi)" >> $GITHUB_ENV
|
echo "SCENARIO_BADGE_COLOR=$(if [ $SCENARIOS_COV_NUMBER -lt '70' ]; then echo 'red'; else echo 'green'; fi)" >> $GITHUB_ENV
|
||||||
- name: Create Parsers badge
|
- name: Create Parsers badge
|
||||||
uses: schneegans/dynamic-badges-action@v1.1.0
|
uses: schneegans/dynamic-badges-action@v1.1.0
|
||||||
if: ${{ env.PUSH_COVERAGE }}
|
if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
with:
|
with:
|
||||||
auth: ${{ secrets.GIST_BADGES_SECRET }}
|
auth: ${{ secrets.GIST_BADGES_SECRET }}
|
||||||
gistID: ${{ secrets.GIST_BADGES_ID }}
|
gistID: ${{ secrets.GIST_BADGES_ID }}
|
||||||
|
@ -64,13 +62,11 @@ jobs:
|
||||||
color: ${{ env.SCENARIO_BADGE_COLOR }}
|
color: ${{ env.SCENARIO_BADGE_COLOR }}
|
||||||
- name: Create Scenarios badge
|
- name: Create Scenarios badge
|
||||||
uses: schneegans/dynamic-badges-action@v1.1.0
|
uses: schneegans/dynamic-badges-action@v1.1.0
|
||||||
if: ${{ env.PUSH_COVERAGE }}
|
if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
with:
|
with:
|
||||||
auth: ${{ secrets.GIST_BADGES_SECRET }}
|
auth: ${{ secrets.GIST_BADGES_SECRET }}
|
||||||
gistID: ${{ secrets.GIST_BADGES_ID }}
|
gistID: ${{ secrets.GIST_BADGES_ID }}
|
||||||
filename: crowdsec_scenarios_badge.json
|
filename: crowdsec_scenarios_badge.json
|
||||||
label: Hub Scenarios
|
label: Hub Scenarios
|
||||||
message: ${{ env.SCENARIOS_COV }}
|
message: ${{ env.SCENARIOS_COV }}
|
||||||
color: ${{ env.SCENARIO_BADGE_COLOR }}
|
color: ${{ env.SCENARIO_BADGE_COLOR }}
|
||||||
|
|
||||||
|
|
|
@ -138,6 +138,9 @@ func (c *Controller) CreateAlert(gctx *gin.Context) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
c.sendAlertToPluginChannel(alert, uint(pIdx))
|
c.sendAlertToPluginChannel(alert, uint(pIdx))
|
||||||
|
if profile.OnSuccess == "break" {
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue