Skip to content

Switch Policy to Alert #1

Switch Policy to Alert

Switch Policy to Alert #1

name: Switch Policy to Alert
on: workflow_dispatch
#push:
#schedule:
# - cron: '15 13-21 * * 1-5'
jobs:
switch-policy-to-alert:
env:
gcp_project: "project1-366201"
region: "us-central1"
application_name: "embedded-my-tomcat-app"
PCC_API: ${{ secrets.PCC_API }}
PCC_KEY: ${{ secrets.PCC_KEY }}
PCC_SEC: ${{ secrets.PCC_SEC }}
runs-on: ubuntu-latest
steps:
- name: Checkout Content from Repo
uses: actions/checkout@v3 # checkout the repository content
- name: setup python
uses: actions/setup-python@v4
with:
python-version: '3.10' # install the python version needed
- name: install python packages for
run: |
python -m pip install --upgrade pip
pip install -r policy/requirements.txt
- name: Generate Compute Login Token
run: python policy/create-token.py
- name: Delete Compute App-Embedded Runtime Policy for Application
run: python policy/delete-policy.py
continue-on-error: true
- name: Create Compute App-Embedded Runtime Policy for Application (Prevent)
run: SCRIPT=alert python policy/create-policy.py