Skip to content

Run Python Script

Run Python Script #1

Workflow file for this run

name: Run Python Script
on:
push:
branches: [ main ]
workflow_dispatch:
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Reset configs directory
run: |
rm -rf configs
mkdir configs
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# If there are any dependencies in your project, add them here.
- name: Make lists
run: |
> uris.txt
python list.py
- name: Upload URIs
uses: actions/upload-artifact@v2
with:
name: uris.txt
path: uris.txt
- name: Check for URI Changes
id: changesRI
run: |
git diff --quiet && echo 'No changes' || echo '::set-output name=changed::true'
- name: Commit and Push URIs if changed
if: steps.changesRI.outputs.changed == 'true'
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit --allow-empty -m "update URIs"
git pull
git push
- name: Run Script
run: python run.py
- name: Upload JSON files
uses: actions/upload-artifact@v2
with:
name: JSON files
path: /configs/*.json
- name: Commit and Push JSONs
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Add generated JSON file"
git pull
git push
- name: Combine JSON files
run: python export.py
- name: Upload Combined JSON file
uses: actions/upload-artifact@v2
with:
name: Combined JSON file
path: configs/combined.json
- name: Export JSON
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Export JSON"
git pull
git push
- name: Create results directory
run: |
rm -rf results
mkdir results
- name: Run script
run: node java/fragment.js
- name: Upload fragment files
uses: actions/upload-artifact@v2
with:
name: JSON files
path: /results/*.json
- name: Commit and Push Fragment
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Add fragment JSON file"
git push
- name: Combine fragment files
run: python fexport.py
- name: Upload Combined fragment file
uses: actions/upload-artifact@v2
with:
name: Combined fragment file
path: results/combined.json
- name: Export Fragmentation
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Export TLS Fragment"
git pull
git push
- name: Convert base64
run: |
> list64
content=$(cat list.txt | base64 | tr -d '\n')
echo "$content" > list64
- name: Check for base64 Changes
id: changes64
run: |
git diff --quiet && echo 'No changes' || echo '::set-output name=changed::true'
- name: Push Base64
if: steps.changes64.outputs.changed == 'true'
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit --allow-empty -m "Convert to base64"
git pull
git push