├── .github ├── KEEP └── workflows │ ├── Clean-Workflows.yaml │ ├── Keep-Alive.yaml │ └── Repo-Sync.yaml ├── LICENSE └── Scripts └── Sync.sh /.github/KEEP: -------------------------------------------------------------------------------- 1 | Sun Jan 1 01:43:59 UTC 2023 2 | -------------------------------------------------------------------------------- /.github/workflows/Clean-Workflows.yaml: -------------------------------------------------------------------------------- 1 | name: Clean Workflow 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | schedule: 7 | - cron: '15 15 */7 * *' 8 | 9 | jobs: 10 | clean: 11 | name: Clean 12 | runs-on: ubuntu-latest 13 | timeout-minutes: 60 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@v2 17 | with: 18 | repository: 'Apocalypsor/Workflows-Cleaner' 19 | - name: Set up Python 20 | uses: actions/setup-python@v2 21 | with: 22 | python-version: '3.9' 23 | - name: Install pipenv 24 | run: python -m pip install --upgrade pipenv wheel 25 | - name: Install dependencies 26 | run: pipenv install 27 | - name: Clean 28 | env: 29 | GITHUB_REPO: ${{ github.repository }} 30 | GITHUB_TOKEN: ${{ secrets.ACTION_SECRET }} 31 | EXPIRE_TIME: '1h' 32 | run: pipenv run python run.py 33 | -------------------------------------------------------------------------------- /.github/workflows/Keep-Alive.yaml: -------------------------------------------------------------------------------- 1 | name: Keep Alive 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | schedule: 7 | - cron: 0 0 */30 * * 8 | 9 | jobs: 10 | keep-alive: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout 14 | uses: actions/checkout@v2 15 | with: 16 | token: ${{ secrets.ACTION_SECRET }} 17 | - name: Keep Alive 18 | run: date > .github/KEEP 19 | - name: Push 20 | uses: stefanzweifel/git-auto-commit-action@v4 21 | with: 22 | commit_message: Keep Alive 23 | skip_dirty_check: false 24 | commit_user_name: Action Bot 25 | commit_user_email: 41898282+github-actions[bot]@users.noreply.github.com 26 | commit_author: Action 27 | -------------------------------------------------------------------------------- /.github/workflows/Repo-Sync.yaml: -------------------------------------------------------------------------------- 1 | name: Repo Sync 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | push: 7 | branches: 8 | - 'main' 9 | paths: 10 | - '.github/workflows/Repo-Sync.yaml' 11 | 12 | schedule: 13 | - cron: 3-53/10 * * * * 14 | 15 | jobs: 16 | microsoft-365-admin: 17 | runs-on: ubuntu-latest 18 | steps: 19 | - name: Sleep Random Time 20 | run: sleep $(shuf -i 10-60 -n 1) 21 | - uses: actions/checkout@v2 22 | - name: Github ➡ Github 23 | id: microsoft-365-admin-update 24 | run: | 25 | dir=$(pwd) 26 | bash Scripts/Sync.sh \ 27 | https://github.com/6mb/Microsoft-365-Admin master \ 28 | https://${{ github.repository_owner }}:${{ secrets.ACTION_SECRET }}@github.com/DovFork/Microsoft-365-Admin keep 29 | [ -f /tmp/update ] && mv /tmp/dest_repo $dir || echo "::set-output name=status::updated" 30 | - name: Set up Docker Buildx 31 | if: steps.microsoft-365-admin-update.outputs.status != 'updated' 32 | uses: docker/setup-buildx-action@v1 33 | - name: Github Docker Login 34 | if: steps.microsoft-365-admin-update.outputs.status != 'updated' 35 | uses: docker/login-action@v1 36 | with: 37 | registry: ghcr.io 38 | username: dovfork 39 | password: ${{ secrets.ACTION_SECRET }} 40 | - name: Build and push 41 | if: steps.microsoft-365-admin-update.outputs.status != 'updated' 42 | uses: docker/build-push-action@v2 43 | with: 44 | context: ./dest_repo 45 | file: ./dest_repo/Dockerfile 46 | platforms: linux/amd64 47 | push: true 48 | tags: | 49 | ghcr.io/dovfork/microsoft-365-admin:latest 50 | 51 | gh-card: 52 | runs-on: ubuntu-latest 53 | steps: 54 | - name: Sleep Random Time 55 | run: sleep $(shuf -i 10-60 -n 1) 56 | - uses: actions/checkout@v2 57 | - name: Github ➡ Github 58 | id: gh-card-update 59 | run: | 60 | dir=$(pwd) 61 | bash Scripts/Sync.sh \ 62 | https://github.com/nwtgck/gh-card develop \ 63 | https://${{ github.repository_owner }}:${{ secrets.ACTION_SECRET }}@github.com/DovFork/gh-card keep 64 | [ -f /tmp/update ] && mv /tmp/dest_repo $dir || echo "::set-output name=status::updated" 65 | - name: Set up Docker Buildx 66 | if: steps.gh-card-update.outputs.status != 'updated' 67 | uses: docker/setup-buildx-action@v1 68 | - name: Github Docker Login 69 | if: steps.gh-card-update.outputs.status != 'updated' 70 | uses: docker/login-action@v1 71 | with: 72 | registry: ghcr.io 73 | username: dovfork 74 | password: ${{ secrets.ACTION_SECRET }} 75 | - name: Build and push for frontend 76 | if: steps.gh-card-update.outputs.status != 'updated' 77 | uses: docker/build-push-action@v2 78 | with: 79 | context: ./dest_repo/frontend 80 | file: ./dest_repo/frontend/Dockerfile 81 | platforms: linux/amd64 82 | push: true 83 | tags: | 84 | ghcr.io/dovfork/gh-card:frontend 85 | - name: Build and push for backend 86 | if: steps.gh-card-update.outputs.status != 'updated' 87 | uses: docker/build-push-action@v2 88 | with: 89 | context: ./dest_repo/backend 90 | file: ./dest_repo/backend/Dockerfile 91 | platforms: linux/amd64 92 | push: true 93 | tags: | 94 | ghcr.io/dovfork/gh-card:backend 95 | 96 | jd-panel: 97 | runs-on: ubuntu-latest 98 | steps: 99 | - name: Sleep Random Time 100 | run: sleep $(shuf -i 10-60 -n 1) 101 | - uses: actions/checkout@v2 102 | - name: Github ➡ Github 103 | id: jd-panel-update 104 | run: | 105 | dir=$(pwd) 106 | bash Scripts/Sync.sh \ 107 | https://github.com/whyour/qinglong master \ 108 | https://${{ github.repository_owner }}:${{ secrets.ACTION_SECRET }}@github.com/DovFork/JD-Panel keep 109 | [ -f /tmp/update ] && mv /tmp/dest_repo $dir || echo "::set-output name=status::updated" 110 | - name: Set up Docker Buildx 111 | if: steps.jd-panel-update.outputs.status != 'updated' 112 | uses: docker/setup-buildx-action@v1 113 | - name: Github Docker Login 114 | if: steps.jd-panel-update.outputs.status != 'updated' 115 | uses: docker/login-action@v1 116 | with: 117 | registry: ghcr.io 118 | username: dovfork 119 | password: ${{ secrets.ACTION_SECRET }} 120 | - name: Build and push 121 | if: steps.jd-panel-update.outputs.status != 'updated' 122 | uses: docker/build-push-action@v2 123 | with: 124 | context: ./dest_repo 125 | file: ./dest_repo/docker/Dockerfile 126 | platforms: linux/amd64 127 | push: true 128 | tags: | 129 | ghcr.io/dovfork/jd-panel:latest 130 | 131 | jd-cookie: 132 | runs-on: ubuntu-latest 133 | steps: 134 | - name: Sleep Random Time 135 | run: sleep $(shuf -i 10-60 -n 1) 136 | - uses: actions/checkout@v2 137 | - name: Github ➡ Github 138 | id: jd-cookie-update 139 | run: | 140 | dir=$(pwd) 141 | bash Scripts/Sync.sh \ 142 | https://github.com/scjtqs2/jd_cookie master \ 143 | https://${{ github.repository_owner }}:${{ secrets.ACTION_SECRET }}@github.com/DovFork/JD-Cookie keep 144 | [ -f /tmp/update ] && mv /tmp/dest_repo $dir || echo "::set-output name=status::updated" 145 | - name: Set up Docker Buildx 146 | if: steps.jd-cookie-update.outputs.status != 'updated' 147 | uses: docker/setup-buildx-action@v1 148 | - name: Github Docker Login 149 | if: steps.jd-cookie-update.outputs.status != 'updated' 150 | uses: docker/login-action@v1 151 | with: 152 | registry: ghcr.io 153 | username: dovfork 154 | password: ${{ secrets.ACTION_SECRET }} 155 | - name: Build and push 156 | if: steps.jd-cookie-update.outputs.status != 'updated' 157 | uses: docker/build-push-action@v2 158 | with: 159 | context: ./dest_repo 160 | file: ./dest_repo/Dockerfile 161 | platforms: linux/amd64 162 | push: true 163 | tags: | 164 | ghcr.io/dovfork/jd-cookie:latest 165 | 166 | jd-scripts: 167 | runs-on: ubuntu-latest 168 | steps: 169 | - name: Sleep Random Time 170 | run: sleep $(shuf -i 10-60 -n 1) 171 | - uses: actions/checkout@v2 172 | - uses: actions/setup-node@v2 173 | with: 174 | node-version: 'lts/*' 175 | - name: Bot 176 | run: | 177 | bash Scripts/Sync.sh \ 178 | https://github.com/SuMaiKaDe/bot main \ 179 | https://${{ github.repository_owner }}:${{ secrets.ACTION_SECRET }}@github.com/DovFork/JD-Bot 180 | - name: JDHelloWorld 181 | run: | 182 | bash Scripts/Sync.sh \ 183 | https://github.com/JDHelloWorld/jd_scripts main \ 184 | https://${{ github.repository_owner }}:${{ secrets.ACTION_SECRET }}@github.com/DovFork/jd-scripts ts2js 185 | - name: hundun 186 | run: | 187 | bash Scripts/Sync.sh \ 188 | https://github.com/whyour/hundun master \ 189 | https://${{ github.repository_owner }}:${{ secrets.ACTION_SECRET }}@github.com/DovFork/hundun 190 | - name: ZCY01 191 | run: | 192 | bash Scripts/Sync.sh \ 193 | https://github.com/ZCY01/daily_scripts main \ 194 | https://${{ github.repository_owner }}:${{ secrets.ACTION_SECRET }}@github.com/DovFork/ZCY01 195 | - name: yangtingxiao 196 | run: | 197 | bash Scripts/Sync.sh \ 198 | https://github.com/yangtingxiao/QuantumultX master \ 199 | https://${{ github.repository_owner }}:${{ secrets.ACTION_SECRET }}@github.com/DovFork/yangtingxiao 200 | - name: JDDJ 201 | run: | 202 | bash Scripts/Sync.sh \ 203 | https://github.com/passerby-b/JDDJ main \ 204 | https://${{ github.repository_owner }}:${{ secrets.ACTION_SECRET }}@github.com/DovFork/JDDJ 205 | - name: longzhuzhu 206 | run: | 207 | bash Scripts/Sync.sh \ 208 | https://github.com/longzhuzhu/nianyu main \ 209 | https://${{ github.repository_owner }}:${{ secrets.ACTION_SECRET }}@github.com/DovFork/longzhuzhu 210 | - name: Ariszy 211 | run: | 212 | bash Scripts/Sync.sh \ 213 | https://github.com/Ariszy/Private-Script master \ 214 | https://${{ github.repository_owner }}:${{ secrets.ACTION_SECRET }}@github.com/DovFork/Ariszy 215 | - name: moposmall 216 | run: | 217 | bash Scripts/Sync.sh \ 218 | https://github.com/moposmall/Script main \ 219 | https://${{ github.repository_owner }}:${{ secrets.ACTION_SECRET }}@github.com/DovFork/moposmall 220 | - name: pxylen 221 | run: | 222 | bash Scripts/Sync.sh \ 223 | https://github.com/pxylen/dog_jd master \ 224 | https://${{ github.repository_owner }}:${{ secrets.ACTION_SECRET }}@github.com/DovFork/pxylen 225 | - name: ztxtop 226 | run: | 227 | bash Scripts/Sync.sh \ 228 | https://github.com/ztxtop/x main \ 229 | https://${{ github.repository_owner }}:${{ secrets.ACTION_SECRET }}@github.com/DovFork/ztxtop 230 | - name: airacg 231 | run: | 232 | bash Scripts/Sync.sh \ 233 | https://github.com/airacg/jd_task main \ 234 | https://${{ github.repository_owner }}:${{ secrets.ACTION_SECRET }}@github.com/DovFork/airacg 235 | - name: JD_Diy 236 | run: | 237 | bash Scripts/Sync.sh \ 238 | https://github.com/chiupam/JD_Diy master \ 239 | https://${{ github.repository_owner }}:${{ secrets.ACTION_SECRET }}@github.com/DovFork/JD-Diy 240 | - name: Sunert 241 | run: | 242 | bash Scripts/Sync.sh \ 243 | https://github.com/Sunert/Script master \ 244 | https://${{ github.repository_owner }}:${{ secrets.ACTION_SECRET }}@github.com/DovFork/Sunert 245 | - name: curtinlv 246 | run: | 247 | bash Scripts/Sync.sh \ 248 | https://github.com/curtinlv/JD-Script main \ 249 | https://${{ github.repository_owner }}:${{ secrets.ACTION_SECRET }}@github.com/DovFork/curtinlv 250 | - name: Tsukasa007 251 | run: | 252 | bash Scripts/Sync.sh \ 253 | https://github.com/Tsukasa007/my_script master \ 254 | https://${{ github.repository_owner }}:${{ secrets.ACTION_SECRET }}@github.com/DovFork/Tsukasa007 255 | - name: jiulan 256 | run: | 257 | bash Scripts/Sync.sh \ 258 | https://github.com/jiulan/platypus main \ 259 | https://${{ github.repository_owner }}:${{ secrets.ACTION_SECRET }}@github.com/DovFork/jiulan 260 | - name: star261 261 | run: | 262 | bash Scripts/Sync.sh \ 263 | https://github.com/star261/jd main \ 264 | https://${{ github.repository_owner }}:${{ secrets.ACTION_SECRET }}@github.com/DovFork/star261 265 | - name: smiek2221 266 | run: | 267 | bash Scripts/Sync.sh \ 268 | https://github.com/smiek2221/scripts master \ 269 | https://${{ github.repository_owner }}:${{ secrets.ACTION_SECRET }}@github.com/DovFork/smiek2221 270 | - name: X1a0He 271 | run: | 272 | bash Scripts/Sync.sh \ 273 | https://github.com/X1a0He/jd_scripts_fixed main \ 274 | https://${{ github.repository_owner }}:${{ secrets.ACTION_SECRET }}@github.com/DovFork/X1a0He 275 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 DovFork 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Scripts/Sync.sh: -------------------------------------------------------------------------------- 1 | ########################################### 2 | # author: Apocalypsor # 3 | # params: (combine with _) # 4 | # - keep: keep /tmp/dest_repo # 5 | # - ts2js: convert ts to js # 6 | ########################################### 7 | 8 | source_repo=$1 9 | source_branch=$2 10 | dest_repo=$3 11 | params=$4 12 | 13 | commit(){ 14 | git config user.email " 41898282+github-actions[bot]@users.noreply.github.com" 15 | git config user.name "Auto Update Bot" 16 | git add . 17 | git commit -am "Update" 18 | git push --porcelain > /tmp/git_log 19 | result=$(grep "up to date" /tmp/git_log) 20 | rm /tmp/git_log 21 | 22 | if [ "$result" ] 23 | then 24 | update=false 25 | else 26 | update=true 27 | fi 28 | } 29 | 30 | echo 31 | echo "-----------------------Cloning destination repo-----------------------" 32 | git clone $dest_repo /tmp/dest_repo 33 | 34 | if [ ! -d "/tmp/dest_repo" ] 35 | then 36 | echo "Failed to clone dest repo!" 37 | exit 1 38 | fi 39 | 40 | cd /tmp/dest_repo 41 | find . -maxdepth 1 -path ./.git -prune -o -exec rm -rf {} \; 2> /dev/null 42 | mkdir /tmp/backup 43 | 44 | echo 45 | echo "--------------------------Cloning source repo-------------------------" 46 | git clone --depth 1 -b $source_branch $source_repo /tmp/source_repo 47 | if [ -d "/tmp/source_repo" ]; then 48 | rm -rf /tmp/source_repo/.git/ 49 | 50 | echo 51 | echo "-----------------------------Syncing repo-----------------------------" 52 | mv -f /tmp/source_repo/* /tmp/dest_repo 53 | 54 | if [[ $params == *"ts2js"* ]] 55 | then 56 | ts_exist=$(find ./ -name "*.ts") 57 | if [ "$ts_exist" ] 58 | then 59 | echo "Converting Typescript files ..." 60 | npm install --no-save typescript 61 | tmp_path=`pwd` 62 | find $tmp_path/ -name "*.ts" -not -path "*/node_modules/*" -exec ./node_modules/.bin/tsc {} >/dev/null 2>&1 \; 63 | mv node_modules /tmp 64 | fi 65 | fi 66 | 67 | rm -f README* 68 | commit 69 | 70 | echo 71 | if $update 72 | then 73 | echo "Repo updated!" 74 | echo "update" > /tmp/update 75 | else 76 | echo "Repo already up-to-date!" 77 | fi 78 | 79 | if [[ $params == *"keep"* ]] 80 | then 81 | rm -rf /tmp/source_repo /tmp/backup 82 | else 83 | rm -rf /tmp/dest_repo /tmp/source_repo /tmp/backup 84 | fi 85 | 86 | else 87 | echo 88 | echo "Error source repo!" 89 | fi 90 | --------------------------------------------------------------------------------