Update sync_wgcf.yml

dependabot/github_actions/docker/setup-buildx-action-2.6.0
fscarmen 3 years ago committed by GitHub
parent 617cba9c2f
commit 7d25b304a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      .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:

Loading…
Cancel
Save