Skip to content

Merge pull request #2 from KevinRohn/fix-deprecated-outputs #36

Merge pull request #2 from KevinRohn/fix-deprecated-outputs

Merge pull request #2 from KevinRohn/fix-deprecated-outputs #36

name: "Obfuscate js test application"
on:
push:
jobs:
test-js-obfuscation:
runs-on: ubuntu-latest
steps:
- name: Set current branch ref
id: git_info
run: |
echo "branch=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
echo "hash=$(git rev-parse --short \"$GITHUB_SHA\")" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
with:
ref: ${{ steps.git_info.outputs.branch }}
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Execute without obfuscation
run: |
npm --prefix example install
node example/index.js
- name: Create distribution path
run: |
mkdir -p dist_low_obfuscation
- name: Low obfuscation test
uses: ./
with:
input_path: example
output_path: dist_low_obfuscation
compact: true
control_flow_flattening: false
dead_code_injection: false
debug_protection: false
debug_protection_interval: 0
log: false
disable_console_output: true
rename_globals: false
string_array_rotate: true
self_defending: true
string_array: true
string_array_encoding: 'none'
string_array_threshold: 0.75
unicode_escape_sequence: false
target: node
- name: Create distribution path
run: |
mkdir -p dist_medium_obfuscation
- name: Medium obfuscation test
uses: ./
with:
input_path: example
output_path: dist_medium_obfuscation
compact: true
control_flow_flattening: true
control_flow_flattening_threshold: 0.75
dead_code_injection: true
dead_code_injection_threshold: 0.4
debug_protection: false
debug_protection_interval: 0
log: false
disable_console_output: true
rename_globals: false
string_array_rotate: true
self_defending: true
string_array: true
string_array_encoding: 'base64'
string_array_threshold: 0.75
unicode_escape_sequence: false
target: node
- name: Create distribution path
run: |
mkdir -p dist_high_obfuscation
- name: High obfuscation test
uses: ./
with:
input_path: example
output_path: dist_high_obfuscation
compact: true
control_flow_flattening: true
control_flow_flattening_threshold: 1
dead_code_injection: true
dead_code_injection_threshold: 1
debug_protection: true
debug_protection_interval: 500
disable_console_output: true
rename_globals: false
string_array_rotate: true
self_defending: true
string_array: true
string_array_encoding: 'rc4'
string_array_threshold: 1
unicode_escape_sequence: false
target: node
- name: upload files
uses: actions/upload-artifact@v4
with:
name: obufscated_example_files
path: |
dist_low_obfuscation/
dist_medium_obfuscation/
dist_high_obfuscation/