diff --git a/.github/workflows/code-analysis-lint-test.yaml b/.github/workflows/code-analysis-lint-test.yaml index e8f2f50d..e5e41bdc 100644 --- a/.github/workflows/code-analysis-lint-test.yaml +++ b/.github/workflows/code-analysis-lint-test.yaml @@ -143,3 +143,19 @@ jobs: with: terraform_wrapper: false - run: make starttestcontainer && make test && make removetestcontainer + + onfailure: + if: ${{ always() && github.event_name == 'schedule' && contains(needs.*.result, 'failure') }} + needs: [test] + name: Send failure webhook + runs-on: ubuntu-latest + steps: + - run: | + curl --silent --request POST "${{ secrets.FAILURE_WEBHOOK_URL }}" \ + --header 'Accept: application/json' \ + --header 'Content-Type: text/plain' \ + --data-raw '{ + "WorkflowName": "${{ github.workflow }}", + "WorkflowURL": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", + "RepoName" : "${{ github.repository }}", + }' \ No newline at end of file diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index cc00ae04..9ac2ed84 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -71,3 +71,19 @@ jobs: uses: github/codeql-action/analyze@v3 with: category: "/language:${{matrix.language}}" + + onfailure: + if: ${{ always() && github.event_name == 'schedule' && contains(needs.*.result, 'failure') }} + needs: [analyze] + name: Send failure webhook + runs-on: ubuntu-latest + steps: + - run: | + curl --silent --request POST "${{ secrets.FAILURE_WEBHOOK_URL }}" \ + --header 'Accept: application/json' \ + --header 'Content-Type: text/plain' \ + --data-raw '{ + "WorkflowName": "${{ github.workflow }}", + "WorkflowURL": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", + "RepoName" : "${{ github.repository }}", + }' \ No newline at end of file