Skip to content

Commit

Permalink
Fix the format in result (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
mponaws authored Apr 22, 2024
1 parent 3e52723 commit 6d974b5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,26 @@ See [action.yml](action.yaml) for the full documentation for this action's input
aws-region: aws-example-region
```

#### Getting started using starter workflows

To get started quickly, add a starter workflow to the `.github/workflows` directory of your repository. In order to do that, do the following -

- Navigate to `Actions` tab of the GitHub repository
- Click on `New Workflow` button
- Search for `Policy Validator for Terraform` in the search bar
- Click on `Configure` button
- Pass the appropriate inputs to the workflow and modify it accordingly
- Click on `Commit changes` to commit your changes
- Start using the GitHub actions!

Please find the starter workflow [here](https://github.com/actions/starter-workflows/blob/main/code-scanning/policy-validator-tf.yaml)

#### Using `VALIDATE_POLICY` CHECK

```
- name: Run VALIDATE_POLICY Check
id: run-validate-policy
uses: aws-actions/[email protected].0
uses: aws-actions/[email protected].1
with:
policy-check-type: 'VALIDATE_POLICY'
template-path: file-path-to-the-cfn-templates
Expand All @@ -165,7 +179,7 @@ See [action.yml](action.yaml) for the full documentation for this action's input
```
- name: Run CHECK_NO_NEW_ACCESS check
id: run-check-no-new-access
uses: aws-actions/[email protected].0
uses: aws-actions/[email protected].1
with:
policy-check-type: 'CHECK_NO_NEW_ACCESS'
template-path: file-path-to-the-cfn-templates
Expand All @@ -179,7 +193,7 @@ See [action.yml](action.yaml) for the full documentation for this action's input
```
- name: Run CHECK_ACCESS_NOT_GRANTED check
id: run-check-no-new-access
uses: aws-actions/[email protected].0
uses: aws-actions/[email protected].1
with:
policy-check-type: 'CHECK_ACCESS_NOT_GRANTED'
template-path: file-path-to-the-cfn-templates
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def set_output(val):


def format_result(result):
result = re.sub(r"[\n\t\s]*", "", result)
result = re.sub(r"[\n\t]*|\s{2,}", "", result)
print("result={}".format(result))
return result

Expand Down

0 comments on commit 6d974b5

Please sign in to comment.