Skip to content

Commit

Permalink
Merge pull request #45 from snyk/feat/add-python38
Browse files Browse the repository at this point in the history
Add python-3.8 variant
  • Loading branch information
JackuB authored Mar 9, 2021
2 parents f17bc82 + 83d25c1 commit 83313a6
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
1 change: 1 addition & 0 deletions build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"Node",
"PHP",
"Python",
"Python-3.8",
"Ruby",
"Scala",
]
Expand Down
47 changes: 47 additions & 0 deletions python-3.8/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Snyk Python 3.8 Action

A [GitHub Action](https://github.com/features/actions) for using [Snyk](https://snyk.co/SnykGH) to check for
vulnerabilities in your Python projects.

You can use the Action as follows:

```yaml
name: Example workflow for Python using Snyk
on: push
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/python-3.8@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
```
The Snyk Python Action has properties which are passed to the underlying image. These are
passed to the action using `with`.

| Property | Default | Description |
| --- | --- | --- |
| args | | Override the default arguments to the Snyk image |
| command | test | Specify which command to run, for instance test or monitor |
| json | false | In addition to the stdout, save the results as snyk.json |

For example, you can choose to only report on high severity vulnerabilities.

```yaml
name: Example workflow for Python using Snyk
on: push
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/python-3.8@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --severity-threshold=high
```
25 changes: 25 additions & 0 deletions python-3.8/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'Snyk Python'
description: 'Check your Python application for vulnerabilties using Snyk'
author: 'Gareth Rushgrove'
branding:
icon: 'alert-triangle'
color: 'yellow'
inputs:
command:
description: 'Which Snyk command to run, defaults to test'
default: test
args:
description: 'Additional arguments to pass to Snyk'
json:
description: 'Output a snyk.json file with results if running the test command'
default: false
runs:
using: 'docker'
image: 'docker://snyk/snyk:python-3.8'
env:
SNYK_INTEGRATION_NAME: GITHUB_ACTIONS
SNYK_INTEGRATION_VERSION: python
args:
- snyk
- ${{ inputs.command }}
- ${{ inputs.args }}

0 comments on commit 83313a6

Please sign in to comment.