Skip to content

Trigger CI

Trigger CI #3

Workflow file for this run

name: Obfuscate JS Code
on:
push:
branches: ["master"]
paths:
- "js/src/*"
permissions:
contents: write
pages: write
id-token: write
jobs:
obfuscate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Obfuscate JS Code
run: |
cd $GITHUB_WORKSPACE/js/src
sudo npm install uglify-js -g
sudo npm install javascript-obfuscator -g
rm ../bundle.min.js
if [ ! -z "${{ secrets.XXTEA_KEY }}" ]; then
sed -i "s/20221209/"${{ secrets.XXTEA_KEY }}"/" ./commands.js
fi
uglifyjs ./terminal.js ./boot.js ./crypto.js ./system.js ./filesystem.js ./commands.js -c -o ./output.js
javascript-obfuscator ./output.js -o ../bundle.min.js --options-preset high-obfuscation
rm ./output.js
- name: Commit files
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -a -m "Obfuscate js code"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}