3 Commits

Author SHA1 Message Date
ff1b0600a2 Merge pull request #1 from mblanke/C2-integration
Add GitHub Actions workflow to unpack files.zip
2025-12-02 16:24:37 -05:00
4a6c613e28 Add GitHub Actions workflow to unpack files.zip 2025-12-02 16:18:15 -05:00
c5e60476e2 chore: Remove accidental file 2025-12-01 08:32:51 -05:00
2 changed files with 57 additions and 21 deletions

57
.github/workflows/unpack-zip.yml vendored Normal file
View File

@@ -0,0 +1,57 @@
name: Unpack files.zip
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch containing files.zip'
required: true
default: 'c2-integration'
jobs:
unpack:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
persist-credentials: true
- name: Ensure unzip available
run: sudo apt-get update -y && sudo apt-get install -y unzip rsync
- name: Verify files.zip exists
run: |
if [ ! -f files.zip ]; then
echo "ERROR: files.zip not found in repo root on branch ${{ github.event.inputs.branch }}"
exit 1
fi
echo "files.zip found:" && ls -lh files.zip
- name: Unpack files.zip
run: |
rm -rf extracted
mkdir -p extracted
unzip -o files.zip -d extracted
echo "Sample extracted files:"
find extracted -maxdepth 3 -type f | sed -n '1,200p'
- name: Copy extracted files into repository
run: |
rsync -a --exclude='.git' extracted/ .
- name: Commit and push changes (if any)
env:
BRANCH: ${{ github.event.inputs.branch }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
if git diff --cached --quiet; then
echo "No changes to commit."
else
git commit -m "Unpack files.zip into branch ${BRANCH} via workflow"
git push origin "HEAD:${BRANCH}"
echo "Changes pushed."
fi

View File

@@ -1,21 +0,0 @@
from fastapi import FastAPI
from starlette.middleware.cors import CORSMiddleware
import os
app = FastAPI()
# CORS middleware
app.add_middleware(
CORSMiddleware,
allow_origins=["*"], # Allows all origins
allow_credentials=True,
allow_methods=["*"], # Allows all methods
allow_headers=["*"], # Allows all headers
)
LLM_ROUTER_URL = os.getenv("LLM_ROUTER_URL", "http://strikepackage-llm-router:8000")
@app.get("/")
async def root():
return {"message": "Hello World"}