-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Updates to support use by addonfactory
- Loading branch information
rfaircloth-splunk
committed
Jun 16, 2021
1 parent
5c2ac68
commit 992b5f5
Showing
7 changed files
with
195 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,129 @@ | ||
.DS_Store | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
pip-wheel-metadata/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
#Pipfile.lock | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"branches": [ | ||
'+([0-9])?(.{+([0-9]),x}).x', | ||
'master', | ||
'main', | ||
'next', | ||
'next-major', | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
# action.yml | ||
name: 'Splunk AppInspect' | ||
description: 'Run Splunk App insect on a Splunk app directory.' | ||
name: "Splunk AppInspect" | ||
description: "Run Splunk App insect on a Splunk app directory." | ||
inputs: | ||
app-path: | ||
description: 'path to the application directory to be inspected' | ||
required: true | ||
result-file: | ||
description: 'json result file name' | ||
default: 'appinspect_result.json' | ||
app_path: | ||
description: "path to the application directory to be inspected" | ||
default: build/splunkbase | ||
result_file: | ||
description: "json result file name" | ||
default: "appinspect_result.json" | ||
included_tags: | ||
description: "Tags to include" | ||
required: false | ||
excluded_tags: | ||
description: "Tags to exclude" | ||
required: false | ||
outputs: | ||
status: | ||
description: 'value is success/fail based on app inspect result' | ||
description: "value is success/fail based on app inspect result" | ||
runs: | ||
using: 'docker' | ||
image: 'docker://ghcr.io/splunk/addonfactory-packaging-toolkit-action:v1.0.0-develop.1' | ||
args: | ||
- ${{ inputs.app-path }} | ||
- ${{ inputs.result-file }} | ||
using: "docker" | ||
image: "docker://ghcr.io/rfaircloth-splunk/appinspect-cli-action-temp:v1.1.10" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,42 @@ | ||
#!/bin/sh -l | ||
#!/usr/bin/env bash | ||
# ######################################################################## | ||
# Copyright 2021 Splunk Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# ######################################################################## | ||
|
||
splunk-appinspect inspect $1 --output-file $2 --mode precert > /dev/null | ||
if [ -f $INPUT_APP_PATH ] | ||
then | ||
SCAN=$INPUT_APP_PATH | ||
else | ||
ls $INPUT_APP_PATH/ | ||
D=$INPUT_APP_PATH | ||
files=($D/*) | ||
SCAN=${files[0]} | ||
fi | ||
echo scan target $SCAN | ||
if [ ! -f $SCAN ]; then echo Unable to locate package $SCAN aborting; exit 1; fi; | ||
|
||
python3 /reporter.py | ||
if [ ! -z $INPUT_INCLUDED_TAGS ]; then INCLUDED_TAGS="--included-tags ${INPUT_INCLUDED_TAGS}"; fi | ||
if [ ! -z $INPUT_EXCLUDED_TAGS ]; then EXCLUDED_TAGS="--excluded-tags ${INPUT_EXCLUDED_TAGS}"; fi | ||
|
||
echo "::group::appinspect" | ||
rm -f $INPUT_RESULT_FILE || true 1>/dev/null | ||
echo running: splunk-appinspect inspect $SCAN --output-file $INPUT_RESULT_FILE --mode test $INCLUDED_TAGS $EXCLUDED_TAGS | ||
splunk-appinspect inspect $SCAN --output-file $INPUT_RESULT_FILE --mode test $INCLUDED_TAGS $EXCLUDED_TAGS | ||
if [ ! -f $INPUT_RESULT_FILE ]; then echo no result file; exit 1; fi | ||
echo "::endgroup::" | ||
|
||
echo "::group::reporter" | ||
python3 /reporter.py $INPUT_RESULT_FILE | ||
echo "::endgroup::" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters