Skip to content

Commit 634ab66

Browse files
authored
Merge pull request #328 from rstudio/mm-snyk
Add Snyk scanning to CI
2 parents 7396898 + 264ff7e commit 634ab66

File tree

3 files changed

+47
-12
lines changed

3 files changed

+47
-12
lines changed

.github/workflows/snyk.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: snyk
2+
on:
3+
schedule:
4+
- cron: "0 10 * * 1" # Monday @ 10am UTC
5+
workflow_dispatch:
6+
7+
env:
8+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
9+
SNYK_ORG: rstudio-connect
10+
SNYK_PROJECT: rsconnect-python
11+
12+
jobs:
13+
python-dependencies:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@master
17+
- name: Run Snyk on dependencies
18+
uses: snyk/actions/python@master
19+
with:
20+
command: monitor
21+
args: --file=setup.py --print-deps --project-name=${{ env.SNYK_PROJECT }} --org=${{ env.SNYK_ORG }}
22+
python-code:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@master
26+
- name: Run Snyk static analysis
27+
uses: snyk/actions/python@master
28+
with:
29+
command: code test
30+
args: --project-name=${{ env.SNYK_PROJECT }} --org=${{ env.SNYK_ORG }}

setup.cfg

-11
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,6 @@ project_urls =
1515
Documentation = https://docs.rstudio.com/rsconnect-python
1616

1717
[options]
18-
install_requires =
19-
six>=1.14.0
20-
click>=8.0.0
21-
pip>=10.0.0
22-
semver>=2.0.0,<3.0.0
23-
pyjwt>=2.4.0
24-
setup_requires =
25-
setuptools
26-
setuptools_scm>=3.4
27-
toml
28-
wheel
2918
packages = rsconnect
3019
python_requires = >=3.7
3120
zip_safe = true

setup.py

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
11
from setuptools import setup
22

3-
setup()
3+
# Dependencies here so Snyk can see them
4+
# https://github.com/snyk/snyk-python-plugin/issues/147
5+
setup(
6+
install_requires=[
7+
"six>=1.14.0",
8+
"click>=7.0.0",
9+
"pip>=10.0.0",
10+
"semver>=2.0.0,<3.0.0",
11+
"pyjwt>=2.4.0",
12+
],
13+
setup_requires=[
14+
"setuptools",
15+
"setuptools_scm>=3.4",
16+
"toml",
17+
"wheel",
18+
],
19+
)

0 commit comments

Comments
 (0)