name: Decode JavaScript File on: push: branches: - main jobs: decode: runs-on: ubuntu-latest permissions: contents: write steps: - name: Checkout repository uses: actions/checkout@v2 # 👇 添加这一步来指定 Node 版本 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '20' # 使用 Node 20 LTS,避免 isolated-vm 编译错误 - name: Execute Python script for decoding run: | python src/decode.py - name: Install dependencies and run decode run: | npm install npm run decode -- -i input.js -o output.js # 修正了参数传递写法 - name: Configure Git author run: | git config --local user.email "action@github.com" git config --local user.name "action" - name: Save decoded output to repository run: | git status ls git add output.js git add output.py git commit -m "Add decoded output file" git push