-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9fa04ef
commit 1ebb7ec
Showing
2 changed files
with
31 additions
and
11 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 |
---|---|---|
|
@@ -29,20 +29,37 @@ jobs: | |
go-version-file: "scripts/cluster-scanner/go.mod" | ||
|
||
- name: Install dependencies | ||
run: | | ||
cd scripts/cluster-scanner/ | ||
go get ./... | ||
working-directory: scripts/cluster-scanner | ||
run: go get ./... | ||
|
||
- name: Execute tests | ||
run: | | ||
cd scripts/cluster-scanner/ | ||
go test ./... | ||
working-directory: scripts/cluster-scanner | ||
run: go test ./... | ||
|
||
- name: Execute the cluster scanner application | ||
id: run_cluster_scanner | ||
working-directory: scripts/cluster-scanner | ||
run: go run . | tee result.log | ||
|
||
- name: Check if clusters have been running for more than 24 hours | ||
id: check_running_clusters | ||
working-directory: scripts/cluster-scanner | ||
run: | | ||
cd scripts/cluster-scanner/ | ||
go run . | ||
if grep -q "The following clusters have been running for more than 24 hours" result.log; then | ||
echo "CLUSTERS_FOUND=true" >> $GITHUB_ENV | ||
fi | ||
# Get the output | ||
# Ignore Slack output if there are no clusters running | ||
# Send slack notification if output is different than what was planned | ||
- name: Send Slack notification | ||
if: env.CLUSTERS_FOUND == 'true' | ||
uses: rtCamp/[email protected] | ||
with: | ||
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }} | ||
SLACK_TOKEN: ${{ secrets.SLACK_PRIVATE_TEAM_TOKEN }} | ||
#SLACK_WEBHOOK: ${{ secrets.SLACK_PRIVATE_TEAM_WEBHOOK }} | ||
SLACK_USERNAME: "spectromate" | ||
SLACK_ICON_EMOJI: ":robot_face:" | ||
SLACK_COLOR: "good" | ||
SLACKIFY_MARKDOWN: true | ||
ENABLE_ESCAPES: true | ||
MESSAGE: | | ||
$(cat scripts/cluster-scanner/result.log) |
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 |
---|---|---|
|
@@ -32,3 +32,6 @@ override.tf.json | |
# Ignore CLI configuration files | ||
.terraformrc | ||
terraform.rc | ||
|
||
# Ignore secrets | ||
.secrets |