From ea112c90913dea61fcd3901a4cfa4c644e5b0939 Mon Sep 17 00:00:00 2001 From: fscarmen <62703343+fscarmen@users.noreply.github.com> Date: Fri, 24 Mar 2023 22:19:38 +0800 Subject: [PATCH] Update sync_warp-go.yml --- .github/workflows/sync_warp-go.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/sync_warp-go.yml b/.github/workflows/sync_warp-go.yml index 9c97cf2..76b6ab7 100644 --- a/.github/workflows/sync_warp-go.yml +++ b/.github/workflows/sync_warp-go.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v3.4.0 - name: Update warp-go to latest version run: | - NOW=$(wget -qO- https://raw.githubusercontent.com/${{ env.USERNAME }}/${{ env.REPO }}/main/warp-go.sh | grep 'latest=${latest' | cut -d \' -f2) + NOW=$(wget -qO- https://raw.githubusercontent.com/${{ github.repository }}/main/warp-go.sh | grep 'latest=${latest' | cut -d \' -f2) LATEST=$(wget -qO- -T1 -t1 https://gitlab.com/api/v4/projects/ProjectWARP%2Fwarp-go/releases | grep -oP '"tag_name":"v\K[^\"]+' | head -n 1) if [ "$LATEST" != "$NOW" ]; then [ ! -d ${GITHUB_WORKSPACE}/warp-go ] && mkdir -p ${GITHUB_WORKSPACE}/warp-go @@ -46,16 +46,14 @@ jobs: echo "VERSION=$LATEST" >> $GITHUB_ENV echo "DIST=${GITHUB_WORKSPACE}/warp-go" >> $GITHUB_ENV + echo "DATE=$(date "+%Y/%m/%d %H:%M:%S")" >> $GITHUB_ENV fi - - name: Upload to REPO + - name: Upload to repository + uses: stefanzweifel/git-auto-commit-action@v4.16.0 if: ${{ env.VERSION != '' }} - run: | - git config --global user.email "${{ env.EMAIL }}" - git config --global user.name "${{ env.USERNAME }}" - git add . - git commit -m "Sync warp-go to V${{ env.VERSION }} by Github Actions, $(date "+%Y/%m/%d %H:%M:%S")" - git push + with: + commit_message: Sync warp-go to V${{ env.VERSION }} by Github Actions, ${{ env.DATE }} - name: Release binaries uses: softprops/action-gh-release@v1