From 6ed4509cbec4c3ba7c22ee948559dd574533eac2 Mon Sep 17 00:00:00 2001 From: snakem982 Date: Fri, 30 Aug 2024 17:56:45 +0800 Subject: [PATCH] add workflow --- .github/workflows/updateclash.yaml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/updateclash.yaml b/.github/workflows/updateclash.yaml index 28ad3e3..f683b2c 100644 --- a/.github/workflows/updateclash.yaml +++ b/.github/workflows/updateclash.yaml @@ -9,24 +9,27 @@ on: jobs: Build: + permissions: write-all runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Git Config - run: | - git config --global user.email snakem982@gmail.com - git config --global user.name snakem982 + persist-credentials: false + fetch-depth: 0 - name: Update Clash run: | wget -O source/clash-meta.yaml ${{ secrets.CLASH_API }} - - name: Git Push + - name: Commit files run: | - git add . - git commit -m "update clash-meta.yaml" - git push origin main + git config --local user.email "snakem982@gmail.com" + git config --local user.name "snakem982" + git commit -a -m "update clash-meta.yaml" + + - name: Git Push + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.ref }}