Add Github Action required files and test workflow.

This commit is contained in:
Yong Yan 2021-06-22 19:17:03 -07:00
parent 53ad19bb3b
commit ad8c4aadf3
4 changed files with 48 additions and 0 deletions

16
.github/workflows/main.yml vendored Normal file
View File

@ -0,0 +1,16 @@
on: [push]
jobs:
sarif:
runs-on: ubuntu-latest
name: Flawfinder
steps:
# To use this repository's private action,
# you must check out the repository
- name: Checkout
uses: actions/checkout@v2
- name: Flawfinder action step
uses: ./ # Uses an action in the root directory
with:
command: '--version'

15
Dockerfile Normal file
View File

@ -0,0 +1,15 @@
# Container image that runs your code
FROM ubuntu:20.04
# Copies your code file from your action repository to the filesystem path `/` of the container
COPY entrypoint.sh /entrypoint.sh
RUN apt update -y
RUN apt install python3-pip -y
RUN pip install flawfinder
# Code file to execute when the docker container starts up (`entrypoint.sh`)
ENTRYPOINT ["/entrypoint.sh"]

12
action.yml Normal file
View File

@ -0,0 +1,12 @@
name: 'Flawfinder'
description: 'Execute Flawfinder'
inputs:
command:
description: 'Command to be sent to Flawfinder'
required: false
default: '--help'
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.command }}

5
entrypoint.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/sh -l
flawfinder $1
echo "Executed with success."