Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattops committed Oct 15, 2024
1 parent 970172c commit 083d423
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/rename_template_project_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
slack_releases_channel:
description: 'Slack channel for release notifications.'
required: true
pipeline_security_slack_channel:
security_alerts_slack_channel_id:
description: 'Slack channel for pipeline security notifications.'
required: true
non_prod_alerts_prometheus_severity_label:
Expand All @@ -28,7 +28,7 @@ jobs:
- uses: actions/checkout@v4

- name: Run rename-project script
run: ./rename-project.bash ${{ github.event.repository.name }} ${{ inputs.slack_releases_channel }} ${{ inputs.pipeline_security_slack_channel }} ${{ inputs.non_prod_alerts_prometheus_severity_label }} ${{ inputs.prod_alerts_prometheus_severity_label }} ${{ inputs.product_id }}
run: ./rename-project.bash ${{ github.event.repository.name }} ${{ inputs.slack_releases_channel }} ${{ inputs.security_alerts_slack_channel_id }} ${{ inputs.non_prod_alerts_prometheus_severity_label }} ${{ inputs.prod_alerts_prometheus_severity_label }} ${{ inputs.product_id }}

- name: Delete this github actions workflow
run: rm .github/workflows/rename_template_project*
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/security_owasp.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Security OWASP dependency check
on:
push:
workflow_dispatch:
schedule:
- cron: "19 6 * * MON-FRI" # Every weekday at 06:19 UTC
Expand Down
7 changes: 5 additions & 2 deletions rename-project.bash
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [[ $# -ge 1 ]]; then
else
read -rp "New project name e.g. prison-visits >" PROJECT_INPUT
read -rp "Slack channel for release notifications >" SLACK_RELEASES_CHANNEL
read -rp "Slack channel for pipeline security notifications >" PIPELINE_SECURITY_SLACK_CHANNEL
read -rp "Slack channel for pipeline security notifications >" SECURITY_ALERTS_SLACK_CHANNEL_ID
echo "For configurating alert severity labels, please first see https://user-guide.cloud-platform.service.justice.gov.uk/documentation/monitoring-an-app/how-to-create-alarms.html#creating-your-own-custom-alerts"
read -rp "Non-prod kubernetes alerts. The severity label used by prometheus to route alert notifications to slack >" NON_PROD_ALERTS_SEVERITY_LABEL
read -rp "Production kubernetes alerts. The severity label used by prometheus to route alert notifications to slack >" PROD_ALERTS_SEVERITY_LABEL
Expand Down Expand Up @@ -90,9 +90,12 @@ sed -i -z -E \
-e "s/security:\n triggers:\n - schedule:\n cron: \"15 7/security:\n triggers:\n - schedule:\n cron: \"$RANDOM_MINUTE $RANDOM_HOUR/" \
-e "s/security-weekly:\n triggers:\n - schedule:\n cron: \"0 5/security-weekly:\n triggers:\n - schedule:\n cron: \"$RANDOM_MINUTE2 $RANDOM_HOUR/" \
-e "s/SLACK_RELEASES_CHANNEL/$SLACK_RELEASES_CHANNEL/" \
-e "s/PIPELINE_SECURITY_SLACK_CHANNEL/$PIPELINE_SECURITY_SLACK_CHANNEL/" \
.circleci/config.yml

sed -i -z -E \
-e "s/SECURITY_ALERTS_SLACK_CHANNEL_ID/$SECURITY_ALERTS_SLACK_CHANNEL_ID/" \
.github/workflows/*

# lastly remove ourselves
rm rename-project.bash

Expand Down

0 comments on commit 083d423

Please sign in to comment.