forked from helm/helm
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
workflow to send codeql result as slack notification
Signed-off-by: Kartikey Mamgain <[email protected]>
- Loading branch information
1 parent
8d74681
commit 8091de8
Showing
1 changed file
with
33 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,10 +13,10 @@ name: "CodeQL" | |
|
||
on: | ||
push: | ||
branches: [ main ] | ||
branches: [ release-3.11 ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [ main ] | ||
branches: [ release-3.11 ] | ||
schedule: | ||
- cron: '29 6 * * 6' | ||
|
||
|
@@ -35,11 +35,11 @@ jobs: | |
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 # [email protected] | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v1 | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
|
@@ -50,7 +50,7 @@ jobs: | |
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v1 | ||
uses: github/codeql-action/autobuild@v2 | ||
|
||
# ℹ️ Command-line programs to run using the OS shell. | ||
# 📚 https://git.io/JvXDl | ||
|
@@ -64,4 +64,31 @@ jobs: | |
# make release | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v1 | ||
id: codeql_analysis | ||
uses: github/codeql-action/analyze@v2 # pinv2.21.2 | ||
|
||
- name: Send message to helm_dev slack channel | ||
id: notify_dev | ||
if: ${{ always() && github.event_name == 'schedule' && steps.codeql_analysis.conclusion != 'success' }} | ||
uses: archive/[email protected] | ||
with: | ||
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_BOT_USER_OAUTH_ACCESS_TOKEN }} | ||
slack-channel: C02979BDUPL | ||
slack-text: Failure! CodeQL analysis for Helm downstream. See '${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}' | ||
|
||
- name: Result from "Send Message to helm_dev slack channel" | ||
if: ${{ always() && github.event_name == 'schedule' && steps.codeql_analysis.conclusion != 'success' }} | ||
run: echo "The result was ${{ steps.notify_dev.outputs.slack-result }}" | ||
|
||
- name: Send message to helm_notify slack channel | ||
id: notify | ||
if: ${{ always() && github.event_name == 'schedule' && steps.codeql_analysis.conclusion == 'success' }} | ||
uses: archive/[email protected] | ||
with: | ||
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_BOT_USER_OAUTH_ACCESS_TOKEN }} | ||
slack-channel: C04K1ARMH8A | ||
slack-text: Success! CodeQL analysis for Helm downstream. See '${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}' | ||
|
||
- name: Result from "Send Message to helm_notify slack channel" | ||
if: ${{ always() && github.event_name == 'schedule' && steps.codeql_analysis.conclusion == 'success' }} | ||
run: echo "The result was ${{ steps.notify.outputs.slack-result }}" |