-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (33 loc) · 1.32 KB
/
policy-prevent-to-alert.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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