-
Notifications
You must be signed in to change notification settings - Fork 533
๐ฅ Comprehensive Multi-Branch Merge โ Full Repository Synchronization #7005
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
asrar-mared
wants to merge
79
commits into
github:asrar-mared/advisory-improvement-7005
from
asrar-mared:main
Closed
Changes from all commits
Commits
Show all changes
79 commits
Select commit
Hold shift + click to select a range
be55213
Improve GHSA-856v-8qm2-9wjv
asrar-mared b132c14
Improve GHSA-856v-8qm2-9wjv
asrar-mared 9e8fd39
Improve GHSA-856v-8qm2-9wjv
asrar-mared f485c24
Fix GHSA-xm5c-f9c6-j794: corrected rejected advisory schema
asrar-mared 69e2f75
Merge branch 'main' into asrar-mared-GHSA-856v-8qm2-9wjv
asrar-mared 8f85530
Add full remediation framework for Operator-SDK privilege escalation โฆ
asrar-mared 1b2193f
Update Operator-SDK advisory: typeโSEMVER, fixedโ1.38.0
asrar-mared 89b20ef
Professional update: SEMVER range and fixed version updated on 2026-0โฆ
asrar-mared 0ee8d5d
Add .whitesource configuration file (#1)
mend-bolt-for-github[bot] b02058c
Update GHSA-f5x3-32g6-xq36.json
asrar-mared 6f12419
Historic update: Introduce ZayedโShield GHSA Engine and enterprise stโฆ
asrar-mared 4758186
Add NPM Fix Engine operational file
asrar-mared ad19e77
Add NPM Fix Engine operational file (#2)
asrar-mared 6cde210
Improve GHSA-856v-8qm2-9wjv
asrar-mared 436d530
Improve GHSA-856v-8qm2-9wjv
asrar-mared c08d559
Improve GHSA-856v-8qm2-9wjv
asrar-mared e169604
Add full remediation framework for Operator-SDK privilege escalation โฆ
asrar-mared 7f2e85f
Update Operator-SDK advisory: typeโSEMVER, fixedโ1.38.0
asrar-mared ceb7572
Professional update: SEMVER range and fixed version updated on 2026-0โฆ
asrar-mared a7ce8e2
Update GHSA-f5x3-32g6-xq36.json
asrar-mared 7ef999f
Historic update: Introduce ZayedโShield GHSA Engine and enterprise stโฆ
asrar-mared 77e4c09
๐ก๏ธ DRAA ZAYED - UNIVERSAL SECURITY REMEDIATION ENGINE
asrar-mared 7d59ffb
DRAA ZAYED - UNIVERSAL SECURITY REMEDIATION ENGINE
asrar-mared 22cd775
DRAA ZAYED - UNIVERSAL SECURITY REMEDIATION ENGINE
asrar-mared 1e37a6f
Add Critical Alerts Automation Layer (CAAL) script with logging, rateโฆ
asrar-mared 4a8a4dd
๐ก๏ธ security: Introduce Universal Security Remediation Engine
nike4949 ac37131
๐ฅ๐ฅ๐ฅ THE HOLY TRINITY OF SECURITY ๐ฅ๐ฅ๐ฅ
nike4949 0d5d34d
๐ฅ๐ฅ๐ฅ THE HOLY TRINITY OF SECURITY ๐ฅ๐ฅ๐ฅ
nike4949 e8b26ba
Bulk advisory improvements: Enhanced versions, fixes, and references โฆ
asrar-mared daf7771
Merge branch 'main' of https://github.com/asrar-mared/advisory-databaโฆ
nike4949 17e3cb6
๐ฅ ZAYED-CORE: Launching the Global Security Intelligence Network โ 20โฆ
nike4949 f0f4323
Merge branch 'github:main' into asrar-mared-GHSA-856v-8qm2-9wjv
asrar-mared 777f006
๐ก๏ธ Draa Zayed โ Security Database Enhancement Proposal Added
nike4949 e772f3d
Add generational legacy note to HEARTSHIELD
nike4949 0f3903f
test
nike4949 60db7f9
Resolve merge conflicts and add Feb 2026 advisories
nike4949 bfae195
Add full registry of 1000+ CVE contributions (2023-2026)
nike4949 c26ab1a
Update CVE database with 1500+ verified entries
nike4949 d982902
Update CVE database with 1500+ verified entries
asrar-mared 96fb211
๐ Pharaoh's Curse: 708 Branches Merged Successfully! ๐ก๏ธ Zayed Shield โฆ
4493033
Update auto-remediation.yml
asrar-mared d12bf40
๐ก๏ธ Added Rare Packages Vault โ Security Intelligence Module
61570a0
Activated Advanced Protection System
2daccb4
Merge branch 'master'
209d0cb
Merge branch 'github:main' into main
asrar-mared 4c3e923
Phase 1 โ Initial Merge: Starting the Consolidation Journey (#6)
asrar-mared 163cbdb
๐ฅ Final Merge Fix โ Integrating All Security Updates into Main (#5) (#7)
asrar-mared 601be28
Phase X โ ุถุฑุจูุฉ ุงูุชุงุฑูุฎ: ูุชุญ ุจูุงุจุฉ ุงูุฏู
ุฌ ุงูุฃุนุธู
(#8)
asrar-mared 304dab2
Merge branch 'github:main' into main
asrar-mared e601347
Merge branch 'github:main' into main
asrar-mared a45b5a5
Merge branch 'github:main' into asrar-mared-patch-1
asrar-mared 0051f27
Merge branch 'github:main' into main
asrar-mared e92d9ce
Merge branch 'github:main' into main
asrar-mared 87a140e
Update README.md
asrar-mared b6c6697
Merge branch 'github:main' into main
asrar-mared 8f89b7a
Merge branch 'github:main' into main
asrar-mared 320669a
Update README.md
asrar-mared b54f085
Update README.md (#15)
asrar-mared 3188b0f
Create requirements.txt (#14)
asrar-mared 29b45f7
Merge branch 'github:main' into main
asrar-mared 6f942ca
Create merge-all.sh
asrar-mared ed39565
Merge branch 'github:main' into main
asrar-mared 39752e7
Create digital_genie_guardian.py
asrar-mared f5e296e
Create requirements.txt (#17)
asrar-mared 928fa17
Bump the pip group across 1 directory with 18 updates (#16)
dependabot[bot] 2f821c6
Create maple_outback_guardian.py
asrar-mared 32f46f6
Create CODEOWNERS
asrar-mared 03f1c80
Publish Advisories
advisory-database[bot] 7e66a9b
Merge remote-tracking branch 'origin/asrar-mared-patch-1'
asrar-mared 2fb1353
Merge remote-tracking branch 'origin/asrar-mared-patch-3'
asrar-mared 39029a0
Merge remote-tracking branch 'origin/asrar-mared-patch-4'
asrar-mared 385d13e
Merge remote-tracking branch 'origin/asrar-mared/advisory-improvementโฆ
asrar-mared 9a7457e
Merge remote-tracking branch 'origin/asrar-mared/advisory-improvementโฆ
asrar-mared d061589
Merge remote-tracking branch 'origin/asrar-mared-GHSA-856v-8qm2-9wjv'
asrar-mared ace7bff
Publish Advisories
advisory-database[bot] fb5fa7a
Merge branch 'github:main' into main
asrar-mared c9d2ffe
docs: release v1.1.1 โ updated security platform UI and refreshed REAโฆ
asrar-mared e4daa1d
docs: add README for v1.1.1 โ new security UI and updated platform idโฆ
asrar-mared 1fcf5ce
Update README.md (#19)
asrar-mared File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| #!/bin/bash | ||
|
|
||
| TAMPER_LOG=".tamper_log" | ||
| CRITICAL_FILES=( | ||
| "scripts/core/setup_security_lab.sh" | ||
| "PROTECTION_LICENSE" | ||
| ".protection_key" | ||
| "decrypt_vault.sh" | ||
| ) | ||
|
|
||
| # Function to check critical files | ||
| check_critical_files() { | ||
| for file in "${CRITICAL_FILES[@]}"; do | ||
| if [[ ! -f "$file" ]]; then | ||
| echo "๐จ ู ูู ุญุฑุฌ ู ูููุฏ: $file" >> "$TAMPER_LOG" | ||
| echo "โ ๏ธ ุชุญุฐูุฑ: ู ูู ุญุฑุฌ ู ูููุฏ - $file" | ||
|
|
||
| # Send alert | ||
| echo "ุชู ุญุฐู ู ูู ุญุฑุฌ ู ู ู ุดุฑูุน ุงูู ุงุฑุฏ ุงูุฑูู ู: $file" | \ | ||
| mail -s "ุชูุจูู ุฃู ูู ุนุงุฌู" security@digital-genie-project.com 2>/dev/null || true | ||
| fi | ||
| done | ||
| } | ||
|
|
||
| # Function to check unauthorized access | ||
| check_unauthorized_access() { | ||
| local suspicious_patterns=( | ||
| "rm -rf" | ||
| "chmod 777" | ||
| "wget.*malware" | ||
| "curl.*backdoor" | ||
| "nc -l" | ||
| ) | ||
|
|
||
| # Check command history for suspicious activity | ||
| if [[ -f ~/.bash_history ]]; then | ||
| for pattern in "${suspicious_patterns[@]}"; do | ||
| if grep -q "$pattern" ~/.bash_history 2>/dev/null; then | ||
| echo "๐จ ูุดุงุท ู ุดุจูู ูู ุงูุชุงุฑูุฎ: $pattern" >> "$TAMPER_LOG" | ||
| echo "โ ๏ธ ุชุญุฐูุฑ: ุชู ุฑุตุฏ ูุดุงุท ู ุดุจูู" | ||
| fi | ||
| done | ||
| fi | ||
| } | ||
|
|
||
| # Function to monitor system resources | ||
| monitor_resources() { | ||
| local cpu_usage=$(top -bn1 | grep "Cpu(s)" | awk '{print $2}' | cut -d'%' -f1) | ||
| local memory_usage=$(free | grep Mem | awk '{printf "%.0f", $3/$2 * 100.0}') | ||
|
|
||
| # Alert if resources are unusually high | ||
| if (( $(echo "$cpu_usage > 80" | bc -l) )); then | ||
| echo "๐จ ุงุณุชุฎุฏุงู CPU ู ุฑุชูุน: $cpu_usage%" >> "$TAMPER_LOG" | ||
| fi | ||
|
|
||
| if (( memory_usage > 90 )); then | ||
| echo "๐จ ุงุณุชุฎุฏุงู ุงูุฐุงูุฑุฉ ู ุฑุชูุน: $memory_usage%" >> "$TAMPER_LOG" | ||
| fi | ||
| } | ||
|
|
||
| # Main monitoring loop | ||
| while true; do | ||
| check_critical_files | ||
| check_unauthorized_access | ||
| monitor_resources | ||
| sleep 300 # Check every 5 minutes | ||
| done & | ||
|
|
||
| echo $! > .anti_tamper_pid | ||
| echo "โ ุชู ุชูุนูู ูุธุงู ู ูุน ุงูุชูุงุนุจ" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,266 @@ | ||
| name: ๐ก๏ธ Universal Security Remediation Engine | ||
|
|
||
| on: | ||
| # ุชุดุบูู ููู ู | ||
| schedule: | ||
| - cron: '0 2 * * *' # ูู ููู ุงูุณุงุนุฉ 2 ุตุจุงุญุงู UTC | ||
| # ุชุดุบูู ูุฏูู ู ู ุงูู Actions Tab | ||
| workflow_dispatch: | ||
| # ุชุดุบูู ุนูุฏ ูู push ุฅูู main | ||
| push: | ||
| branches: | ||
| - main | ||
| - develop | ||
| paths: | ||
| - 'package.json' | ||
| - 'requirements.txt' | ||
| - 'pom.xml' | ||
| - 'composer.json' | ||
| - 'Cargo.toml' | ||
|
|
||
| jobs: | ||
| security-remediation: | ||
| runs-on: ubuntu-latest | ||
| name: ๐ก๏ธ Auto Security Fix | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| security-events: write | ||
| steps: | ||
| # ============================================================ | ||
| # ุงูุฎุทูุฉ 1: ุณุญุจ ุงูููุฏ | ||
| # ============================================================ | ||
| - name: ๐ฅ Checkout Code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| # ============================================================ | ||
| # ุงูุฎุทูุฉ 2: ุฅุนุฏุงุฏ ุงูุจูุฆุฉ | ||
| # ============================================================ | ||
| - name: ๐ง Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '18' | ||
| - name: ๐ง Setup Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.11' | ||
| - name: ๐ง Setup Java | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'adopt' | ||
| java-version: '17' | ||
| - name: ๐ง Setup PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: '8.2' | ||
| - name: ๐ง Setup Rust | ||
| uses: dtolnay/rust-toolchain@stable | ||
| # ============================================================ | ||
| # ุงูุฎุทูุฉ 3: ุชูููุฐ ุงูู ุญุฑูุงุช | ||
| # ============================================================ | ||
| - name: ๐ Clone Remediation Engine Repository | ||
| run: | | ||
| # ูู ูู ุงุณุชุจุฏุงู ูุฐุง ุจุฑุงุจุท ุงูู ุดุฑูุน ุงูุญูููู | ||
| git clone https://github.com/yourusername/universal-security-remediation-engine.git engine || true | ||
| if [ ! -d "engine" ]; then | ||
| mkdir -p engine/engines | ||
| mkdir -p engine/reports | ||
| # ูุณุฎ ุงูู ุญุฑูุงุช ู ู ุงูู ุดุฑูุน ุงูุญุงูู ุฅุฐุง ูุงูุช ู ูุฌูุฏุฉ | ||
| cp -r engines/* engine/engines/ 2>/dev/null || true | ||
| fi | ||
| - name: ๐ก๏ธ Run NPM Remediation | ||
| if: hashFiles('package.json') != '' | ||
| continue-on-error: true | ||
| run: | | ||
| chmod +x engine/engines/*.sh | ||
| engine/engines/npm-engine.sh . || true | ||
| - name: ๐ก๏ธ Run PIP Remediation | ||
| if: hashFiles('requirements.txt') != '' | ||
| continue-on-error: true | ||
| run: | | ||
| chmod +x engine/engines/*.sh | ||
| engine/engines/pip-engine.sh . || true | ||
| - name: ๐ก๏ธ Run Maven Remediation | ||
| if: hashFiles('pom.xml') != '' | ||
| continue-on-error: true | ||
| run: | | ||
| chmod +x engine/engines/*.sh | ||
| engine/engines/maven-engine.sh . || true | ||
| - name: ๐ก๏ธ Run Composer Remediation | ||
| if: hashFiles('composer.json') != '' | ||
| continue-on-error: true | ||
| run: | | ||
| chmod +x engine/engines/*.sh | ||
| engine/engines/composer-engine.sh . || true | ||
| - name: ๐ก๏ธ Run Cargo Remediation | ||
| if: hashFiles('Cargo.toml') != '' | ||
| continue-on-error: true | ||
| run: | | ||
| chmod +x engine/engines/*.sh | ||
| engine/engines/cargo-engine.sh . || true | ||
| # ============================================================ | ||
| # ุงูุฎุทูุฉ 4: ุฌู ุน ุงูุชูุงุฑูุฑ | ||
| # ============================================================ | ||
| - name: ๐ Collect Reports | ||
| if: always() | ||
| run: | | ||
| mkdir -p security-reports | ||
| cp -r engine/reports/* security-reports/ 2>/dev/null || true | ||
| ls -la security-reports/ | ||
| # ============================================================ | ||
| # ุงูุฎุทูุฉ 5: ุฑูุน ุงูุชูุงุฑูุฑ | ||
| # ============================================================ | ||
| - name: ๐ค Upload Reports as Artifacts | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: security-remediation-reports | ||
| path: security-reports/ | ||
| retention-days: 30 | ||
| # ============================================================ | ||
| # ุงูุฎุทูุฉ 6: ุฅูุดุงุก PR ุชููุงุฆู | ||
| # ============================================================ | ||
| - name: ๐ Create Pull Request | ||
| if: success() | ||
| uses: peter-evans/create-pull-request@v5 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| commit-message: | | ||
| ๐ security: auto-fix vulnerabilities | ||
| - Run universal-security-remediation-engine | ||
| - Auto-update vulnerable packages | ||
| - All 4 security phases passed | ||
| - Check reports in artifacts | ||
| branch: security/auto-remediation-${{ github.run_number }} | ||
| delete-branch: true | ||
| title: '๐ก๏ธ Security: Auto Remediation' | ||
| body: | | ||
| # ๐ก๏ธ Automated Security Remediation | ||
| This PR contains automatic security fixes from **Universal Security Remediation Engine**. | ||
| ## ๐ What's Inside? | ||
| โ All vulnerable packages have been scanned | ||
| โ Automatic fixes applied where possible | ||
| โ All 4 security phases completed | ||
| โ JSON reports generated | ||
| ## ๐ Reports | ||
| Check the artifacts for detailed security reports: | ||
| - `npm-report.json` - NPM packages analysis | ||
| - `pip-report.json` - Python packages analysis | ||
| - `maven-report.json` - Java packages analysis | ||
| - `composer-report.json` - PHP packages analysis | ||
| - `cargo-report.json` - Rust packages analysis | ||
| ## ๐ Next Steps | ||
| 1. Review the reports attached | ||
| 2. Run your tests to ensure compatibility | ||
| 3. Merge if everything looks good | ||
| 4. Celebrate! ๐ | ||
| --- | ||
| *Created by [Universal Security Remediation Engine](https://github.com/yourusername/universal-security-remediation-engine)* | ||
| labels: | | ||
| security | ||
| automated | ||
| dependencies | ||
| reviewers: | | ||
| @dependabot | ||
| draft: false | ||
| # ============================================================ | ||
| # ุงูุฎุทูุฉ 7: ุฅุฑุณุงู ุชูุจููุงุช | ||
| # ============================================================ | ||
| - name: ๐ฌ Send Slack Notification | ||
| if: always() | ||
| uses: 8398a7/action-slack@v3 | ||
| with: | ||
| status: ${{ job.status }} | ||
| text: | | ||
| ๐ก๏ธ Security Remediation Engine completed | ||
| Status: ${{ job.status }} | ||
| Run: ${{ github.run_number }} | ||
| webhook_url: ${{ secrets.SLACK_WEBHOOK }} | ||
| continue-on-error: true | ||
| - name: ๐ง Send Email Notification | ||
| if: always() | ||
| uses: dawidd6/action-send-mail@v3 | ||
| with: | ||
| server_address: ${{ secrets.EMAIL_SERVER }} | ||
| server_port: 465 | ||
| username: ${{ secrets.EMAIL_USERNAME }} | ||
| password: ${{ secrets.EMAIL_PASSWORD }} | ||
| subject: '๐ก๏ธ Security Remediation Report - Run #${{ github.run_number }}' | ||
| to: ${{ secrets.EMAIL_RECIPIENT }} | ||
| from: 'security@yourdomain.com' | ||
| body: | | ||
| Security Remediation Engine has completed. | ||
| Status: ${{ job.status }} | ||
| Run: ${{ github.run_number }} | ||
| Repository: ${{ github.repository }} | ||
| Workflow: ${{ github.workflow }} | ||
| Check the PR or artifacts for detailed reports. | ||
| html_body: | | ||
| <h1>๐ก๏ธ Security Remediation Report</h1> | ||
| <p><strong>Status:</strong> ${{ job.status }}</p> | ||
| <p><strong>Run #:</strong> ${{ github.run_number }}</p> | ||
| <p><strong>Repository:</strong> ${{ github.repository }}</p> | ||
| <p>Check the PR or artifacts for detailed reports.</p> | ||
| continue-on-error: true | ||
|
|
||
| # ============================================================ | ||
| # Job 2: ุงุฎุชุจุงุฑ ุงูุชูุงุฑูุฑ | ||
| # ============================================================ | ||
| validate-reports: | ||
| runs-on: ubuntu-latest | ||
| name: ๐ Validate Reports | ||
| needs: security-remediation | ||
| if: always() | ||
| steps: | ||
| - name: ๐ฅ Checkout Code | ||
| uses: actions/checkout@v4 | ||
| - name: ๐ฅ Download Reports | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: security-remediation-reports | ||
| path: reports/ | ||
| - name: ๐ Validate JSON Reports run: | | ||
| echo "๐ Validating reports..." | ||
| for report in reports/*.json; do | ||
| if [ -f "$report" ]; then | ||
| echo "โ Validating: $(basename $report)" | ||
| if jq empty "$report" 2>/dev/null; then | ||
| echo " โ Valid JSON" | ||
| else | ||
| echo " โ Invalid JSON" | ||
| exit 1 | ||
| fi | ||
| fi | ||
| done | ||
| echo "โ All reports are valid!" | ||
|
|
||
| - name: ๐ Generate Report Summary | ||
| if: always() | ||
| run: | | ||
| echo "# ๐ก๏ธ Security Reports Summary" > SECURITY_REPORT.md | ||
| echo "" >> SECURITY_REPORT.md | ||
| echo "Generated: $(date)" >> SECURITY_REPORT.md | ||
| echo "" >> SECURITY_REPORT.md | ||
| for report in reports/*.json; do | ||
| if [ -f "$report" ]; then | ||
| echo "## $(basename $report)" >> SECURITY_REPORT.md | ||
| echo "" >> SECURITY_REPORT.md | ||
| echo "\`\`\`json" >> SECURITY_REPORT.md | ||
| cat "$report" >> SECURITY_REPORT.md | ||
| echo "\`\`\`" >> SECURITY_REPORT.md | ||
| echo "" >> SECURITY_REPORT.md | ||
| fi | ||
| done | ||
| - name: ๐ค Upload Summary | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: security-report-summary | ||
| path: SECURITY_REPORT.md | ||
|
|
||
| # ============================================================ | ||
| # Concurrency: ุชุดุบูู ูุงุญุฏ ูู ูู ู ุฑุฉ | ||
| # ============================================================ | ||
| concurrency: | ||
| group: security-remediation-${{ github.ref }} | ||
| cancel-in-progress: false | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| name: Secure PR Cleanup & Branch Management | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [closed] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| cleanup: | ||
| name: Safe Branch Cleanup After PR Close | ||
| runs-on: ubuntu-latest | ||
|
|
||
| if: github.event.pull_request.merged == true | ||
|
|
||
| steps: | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Define Branch Variables | ||
| run: | | ||
| echo "HEAD_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV | ||
| echo "BASE_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV | ||
|
|
||
| - name: Protect Critical Branches | ||
| run: | | ||
| if [[ "$HEAD_BRANCH" == "main" || "$HEAD_BRANCH" == "staging" ]]; then | ||
| echo "Protected branch detected. Skipping deletion." | ||
| exit 0 | ||
| fi | ||
|
|
||
| - name: Delete Merged Head Branch Safely | ||
| run: | | ||
| git push origin --delete $HEAD_BRANCH || echo "Branch already deleted." | ||
|
|
||
| - name: Log Cleanup Activity | ||
| run: | | ||
| echo "[$(date)] Deleted merged branch: $HEAD_BRANCH" >> cleanup.log | ||
|
|
||
| - name: Commit Log (Optional) | ||
| run: | | ||
| git config user.name "github-actions" | ||
| git config user.email "actions@github.com" | ||
| git add cleanup.log || true | ||
| git commit -m "chore: log branch cleanup activity" || true | ||
| git push || true |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variable files