name: Sync Repositories Workflow
on:
  push:
    paths:
    - '.new-additions'
    - '.github/scripts/yaml2json/go.mod'
    - '.github/scripts/yaml2json/go.sum'
    - '.github/workflows/tests.yml'
    - 'CVE-2024-7339.yaml'
    - 'http/cves/2022/CVE-2022-27043.yaml'
    - 'http/cves/2023/CVE-2023-43323.yaml'
    - 'http/cves/2023/CVE-2023-44393.yaml'
    - 'http/cves/2023/CVE-2023-5222.yaml'
    - 'http/cves/2024/CVE-2024-24763.yaml'
    - 'http/cves/2024/CVE-2024-34061.yaml'
    - 'http/cves/2024/CVE-2024-36104.yaml'
    - 'http/cves/2024/CVE-2024-38856.yaml'
    - 'http/cves/2024/CVE-2024-39903.yaml'
    - 'http/cves/2024/CVE-2024-39907.yaml'
    - 'http/cves/2024/CVE-2024-40422.yaml'
    - 'http/cves/2024/CVE-2024-41107.yaml'
    - 'http/cves/2024/CVE-2024-41628.yaml'
    - 'http/cves/2024/CVE-2024-5975.yaml'
    - 'http/cves/2024/CVE-2024-6205.yaml'
    - 'http/cves/2024/CVE-2024-6366.yaml'
    - 'http/cves/2024/CVE-2024-6396.yaml'
    - 'http/cves/2024/CVE-2024-6781.yaml'
    - 'http/cves/2024/CVE-2024-6782.yaml'
    - 'http/cves/2024/CVE-2024-6922.yaml'
    - 'http/cves/2024/CVE-2024-7008.yaml'
    - 'http/cves/2024/CVE-2024-7120.yaml'
    - 'http/cves/2024/CVE-2024-7188.yaml'
    - 'http/cves/2024/CVE-2024-7332.yaml'
    - 'http/cves/2024/CVE-2024-7340.yaml'
    - 'http/default-logins/apache/cloudstack-default-login.yaml'
    - 'http/exposed-panels/airos-panel.yaml'
    - 'http/exposed-panels/metube-panel.yaml'
    - 'http/exposed-panels/openedge-panel.yaml'
    - 'http/exposed-panels/whatsup-gold-panel.yaml'
    - 'http/exposures/files/gitlab-ci-yml.yaml'
    - 'http/misconfiguration/changedetection-unauth.yaml'
    - 'http/misconfiguration/deployment-interface-exposed.yaml'
    - 'http/misconfiguration/installer/quickcms-installer.yaml'
    - 'http/misconfiguration/manage-cabinet-register.yaml'
    - 'http/osint/user-enumeration/substack.yaml'
    - 'http/technologies/apache/apache-ofbiz-detect.yaml'
    - 'http/technologies/apache/apache-shenyu-detect.yaml'
    - 'http/technologies/searxng-detect.yaml'
    - 'http/vulnerabilities/esafenet/esafenet-netsecconfigajax-sqli.yaml'
    - 'http/vulnerabilities/esafenet/esafenet-noticeajax-sqli.yaml'
    - 'http/vulnerabilities/landray/landray-oa-replaceextend-rce.yaml'
    - 'javascript/misconfiguration/x11/x11-unauth-access.yaml'
    - 'javascript/udp/detection/db2-discover.yaml'
  workflow_dispatch:
  workflow_call:

jobs:
  sync:
    if: github.repository == 'projectdiscovery/nuclei-templates'
    runs-on: ubuntu-latest
    steps:
    - uses: projectdiscovery/actions/templates/sync@v1
      with:
        token: ${{ secrets.GTOKEN }}
