Build SingBox Configs #5
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
| name: Build SingBox Config | |
| on: | |
| schedule: | |
| - cron: "0 */6 * * *" | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Build config via API | |
| run: | | |
| SUB=$(curl -s https://YOUR_SUB_URL | tr -d '\r') | |
| curl -sS -X POST "https://api.web2core.workers.dev/" -H "Content-Type: application/json" --data-binary @- <<EOF > config.json | |
| { | |
| "core": "singbox", | |
| "input": "$SUB", | |
| "options": { | |
| "addTun": true, | |
| "addSocks": true, | |
| "useExtended": false | |
| } | |
| } | |
| EOF | |
| - name: Commit config | |
| run: | | |
| git config user.name "github-actions" | |
| git config user.email "actions@github.com" | |
| git add config.json | |
| git commit -m "auto update config" || exit 0 | |
| git push |