Skip to content

Commit

Permalink
chore: convert to JS action
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgilman committed Aug 30, 2024
1 parent eb6cfdc commit e7ea113
Show file tree
Hide file tree
Showing 14 changed files with 11,982 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
^check.*
^test.*
- name: Show output
run: echo "${{ steps.discovery.outputs.json }}"
run: echo "${{ steps.discovery.outputs.result }}"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Node
node_modules
49 changes: 49 additions & 0 deletions forge/actions/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
env:
commonjs: true
es6: true
jest: true
node: true

globals:
Atomics: readonly
SharedArrayBuffer: readonly

ignorePatterns:
- 'node_modules/'
- 'dist/'
- 'coverage/'
- '*.json'

parser: '@babel/eslint-parser'

parserOptions:
ecmaVersion: 2023
sourceType: module
requireConfigFile: false
babelOptions:
babelrc: false
configFile: false
presets:
- jest

plugins:
- jest

extends:
- eslint:recommended
- plugin:github/recommended
- plugin:jest/recommended

rules:
{
'camelcase': 'off',
'eslint-comments/no-use': 'off',
'eslint-comments/no-unused-disable': 'off',
'i18n-text/no-en': 'off',
'import/no-commonjs': 'off',
'import/no-namespace': 'off',
'no-console': 'off',
'no-unused-vars': 'off',
'prettier/prettier': 'error',
'semi': 'off'
}
1 change: 1 addition & 0 deletions forge/actions/discovery/.node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.14.0
3 changes: 3 additions & 0 deletions forge/actions/discovery/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Discover Action

TODO
24 changes: 4 additions & 20 deletions forge/actions/discovery/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,9 @@ inputs:
description: The path to search from
default: "."
outputs:
json:
result:
description: The result of the discovery
value: ${{ steps.discover.outputs.json }}
runs:
using: composite
steps:
- name: Discover
id: discover
shell: bash
run: |
FILTERS="${{ inputs.filters }}"
FILTERS="$(echo "${FILTERS}" | tr '\n' ' ' | sed 's/ $//')"
FLAGS=""
for filter in $FILTERS; do
FLAGS+="-f $filter "
done

OUTPUT=$(forge -vvv scan $FLAGS "${{ inputs.path }}" 2> >(tee /dev/stderr))
echo "Output: $OUTPUT"
#OUTPUT=$(echo $OUTPUT | jq -rc)
#echo "json=$OUTPUT" >> $GITHUB_OUTPUT
runs:
using: node20
main: dist/index.js
Loading

0 comments on commit e7ea113

Please sign in to comment.