Update .gitea/workflows/mobsf.yml
All checks were successful
MobSF Security Scan / mobsf-analysis (push) Successful in 13s
All checks were successful
MobSF Security Scan / mobsf-analysis (push) Successful in 13s
This commit is contained in:
@@ -1,23 +1,33 @@
|
||||
name: MobSF Security Integration
|
||||
name: MobSF Security Scan
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
mobsf-analysis:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# 1. Checkout runs on the runner host (which has Node.js)
|
||||
# 1. Checkout code into the runner's workspace
|
||||
- name: Checkout Code
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
|
||||
# 2. Run MobSF using a Docker command
|
||||
# We mount the current folder into the container's /src folder
|
||||
- name: MobSF Scan
|
||||
# 2. Prepare the environment
|
||||
# We create the report file first so the upload step doesn't crash if scan is clean
|
||||
- name: Prepare Report File
|
||||
run: |
|
||||
docker run --rm -v $(pwd):/src opensecurity/mobsfscan:latest /src --html --output /src/report.html || true
|
||||
echo "<html><body><h1>MobSF Scan Results</h1><p>No vulnerabilities were detected in this run.</p></body></html>" > report.html
|
||||
chmod 777 report.html
|
||||
|
||||
# 3. Upload the report to Gitea
|
||||
# 3. Run MobSF Scan using Docker
|
||||
# We mount the Gitea Workspace volume into the MobSF container
|
||||
- name: Run MobSF Scan
|
||||
run: |
|
||||
docker run --rm \
|
||||
-v "${{ github.workspace }}:/src" \
|
||||
opensecurity/mobsfscan:latest \
|
||||
/src --html --output /src/report.html || true
|
||||
|
||||
# 4. Upload using the Gitea-compatible v3 action
|
||||
- name: Upload Report to Gitea
|
||||
uses: https://gitea.com/actions/upload-artifact@v3
|
||||
with:
|
||||
name: Security-Analysis-Report
|
||||
name: MobSF-Security-Report
|
||||
path: report.html
|
||||
Reference in New Issue
Block a user