diff --git a/.github/workflows/sync_wgcf.yml b/.github/workflows/sync_wgcf.yml index 56c9d9a..6278cea 100644 --- a/.github/workflows/sync_wgcf.yml +++ b/.github/workflows/sync_wgcf.yml @@ -8,16 +8,17 @@ on: jobs: build: name: Sync wgcf latest version + runs-on: ubuntu-latest + env: - USERNAME: ${{ secrets.GH_USERNAME }} - EMAIL: ${{ secrets.GH_EMAIL }} + FILE_DIR: wgcf steps: - uses: actions/checkout@v3.4.0 - name: Update wgcf to latest version run: | - NOW=$(wget -qO- https://raw.githubusercontent.com/${{ env.USERNAME }}/test/main/menu.sh | grep 'latest=${latest' | cut -d \' -f2) + NOW=$(wget -qO- https://raw.githubusercontent.com/${{ github.repository }}/main/menu.sh | grep 'latest=${latest' | cut -d \' -f2) LATEST=$(wget -qO- "https://api.github.com/repos/ViRb3/wgcf/releases/latest" | grep "tag_name" | head -n 1 | cut -d : -f2 | sed 's/[ \"v,]//g') if [ "$LATEST" != "$NOW" ]; then @@ -43,11 +44,15 @@ jobs: rm -f ${GITHUB_WORKSPACE}/wgcf/wgcf_"$NOW"_"$i" done + for j in "${SCRIPTS[@]}"; do + sed -i "s/$NOW/$LATEST/g" ${GITHUB_WORKSPACE}/$j + done + echo "VERSION=$LATEST" >> $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 != '' }} with: