Skip to content

Commit 6c4a80c

Browse files
committed
Merge branch 'master' of https://github.com/RADAR-base/RADAR-RedcapIntegration into release-1.0.6
2 parents bbe8192 + ed70d2e commit 6c4a80c

File tree

4 files changed

+127
-26
lines changed

4 files changed

+127
-26
lines changed

.github/workflows/release.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Create release files
2+
name: Release
3+
4+
on:
5+
release:
6+
types: [ published ]
7+
8+
env:
9+
DOCKER_IMAGE: radarbase/radar-redcapintegration
10+
11+
jobs:
12+
# Build and push tagged release docker image
13+
docker:
14+
# The type of runner that the job will run on
15+
runs-on: ubuntu-latest
16+
17+
# Steps represent a sequence of tasks that will be executed as part of the job
18+
steps:
19+
- uses: actions/checkout@v3
20+
21+
# Add Docker labels and tags
22+
- name: Docker meta
23+
id: docker_meta
24+
uses: docker/metadata-action@v4
25+
with:
26+
images: ${{ env.DOCKER_IMAGE }}
27+
tags: |
28+
type=semver,pattern={{version}}
29+
type=semver,pattern={{major}}.{{minor}}
30+
31+
- name: Login to DockerHub
32+
uses: docker/login-action@v2
33+
with:
34+
username: ${{ secrets.DOCKERHUB_USERNAME }}
35+
password: ${{ secrets.DOCKERHUB_TOKEN }}
36+
37+
- name: Build and push
38+
id: docker_build
39+
uses: docker/build-push-action@v3
40+
with:
41+
# Allow running the image on the architectures supported by openjdk:11-jre-slim
42+
push: true
43+
tags: ${{ steps.docker_meta.outputs.tags }}
44+
context: .
45+
# Use runtime labels from docker_meta as well as fixed labels
46+
labels: |
47+
${{ steps.docker_meta.outputs.labels }}
48+
maintainer=Yatharth Ranjan <[email protected]>
49+
org.opencontainers.image.authors=Yatharth Ranjan @yatharthranjan, Pauline Conde @mpgxvii, Pim van Nierop @pvanierop
50+
org.opencontainers.image.vendor=RADAR-base
51+
org.opencontainers.image.licenses=Apache-2.0
52+
53+
- name: Inspect image
54+
run: |
55+
docker pull ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}
56+
docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Snyk scheduled Docker base image scan
2+
3+
on:
4+
schedule:
5+
- cron: '0 3 * * 1'
6+
workflow_dispatch:
7+
8+
env:
9+
DOCKER_IMAGE: radarbase/radar-redcapintegration
10+
11+
jobs:
12+
security:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- name: Run Snyk to check for vulnerabilities
19+
continue-on-error: true # To make sure that SARIF upload gets called
20+
uses: snyk/actions/docker@master
21+
env:
22+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
23+
with:
24+
image: ${{ env.DOCKER_IMAGE }}
25+
# 'exclude-app-vulns' only tests vulnerabilities in the base image.
26+
# Code base vulnerabilities are tested the scheduled-snyk.yaml action.
27+
args: >-
28+
--file=Dockerfile
29+
--fail-on=upgradable
30+
--severity-threshold=high
31+
--policy-path=.snyk
32+
--exclude-app-vulns
33+
--org=radar-base
34+
--sarif-file-output=snyk.sarif
35+
36+
# Detected vulnerabilities will appear on Github in Security->Code_scanning_alerts tab
37+
- name: Upload result to GitHub Code Scanning
38+
uses: github/codeql-action/upload-sarif@v3
39+
with:
40+
sarif_file: snyk.sarif
Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,34 @@
1-
name: Snyk scheduled test
1+
name: Snyk scheduled code base scan
2+
23
on:
34
schedule:
45
- cron: '0 2 * * 1'
5-
push:
6-
branches:
7-
- master
6+
workflow_dispatch:
87

98
jobs:
109
security:
1110
runs-on: ubuntu-latest
12-
env:
13-
REPORT_FILE: test.json
11+
1412
steps:
1513
- uses: actions/checkout@v3
1614

17-
- name: Use Node.js 16
18-
uses: actions/setup-node@v3
19-
with:
20-
node-version: 16
21-
2215
- name: Run Snyk to check for vulnerabilities
2316
uses: snyk/actions/gradle-jdk17@master
17+
continue-on-error: true # To make sure that SARIF upload gets called
2418
env:
2519
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
2620
with:
27-
args: --all-projects --configuration-matching='^runtimeClasspath$' --json-file-output=${{ env.REPORT_FILE }} --severity-threshold=high --policy-path=$PWD/.snyk
21+
args: >-
22+
--all-projects
23+
--configuration-matching='^runtimeClasspath$'
24+
--fail-on=upgradable
25+
--severity-threshold=high
26+
--policy-path=.snykS
27+
--org=radar-base
28+
--sarif-file-output=snyk.sarif
2829
29-
- name: Report new vulnerabilities
30-
uses: thehyve/report-vulnerability@master
31-
if: success() || failure()
30+
# Detected vulnerabilities will appear on Github in Security->Codescanning_alerts tab
31+
- name: Upload result to GitHub Code Scanning
32+
uses: github/codeql-action/upload-sarif@v3
3233
with:
33-
report-file: ${{ env.REPORT_FILE }}
34-
env:
35-
TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
sarif_file: snyk.sarif

.github/workflows/snyk.yaml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
1-
name: Snyk test
1+
name: Snyk test on PR commits
2+
23
on:
34
pull_request:
4-
branches: [ master, dev ]
5+
branches:
6+
- main
7+
- dev
8+
- release-*
9+
510
jobs:
611
security:
712
runs-on: ubuntu-latest
813
steps:
914
- uses: actions/checkout@v3
1015

11-
- name: Use Node.js 16
12-
uses: actions/setup-node@v3
13-
with:
14-
node-version: 16
15-
1616
- name: Run Snyk to check for vulnerabilities
1717
uses: snyk/actions/gradle-jdk17@master
1818
env:
1919
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
2020
with:
21-
args: --all-projects --configuration-matching='^runtimeClasspath$' --severity-threshold=high --policy-path=$PWD/.snyk
21+
args: >-
22+
--all-projects
23+
--configuration-matching="^runtimeClasspath$"
24+
--severity-threshold=high
25+
--fail-on=upgradable
26+
--org=radar-base
27+
--policy-path=.snyk

0 commit comments

Comments
 (0)