Update logo.yml

This commit is contained in:
张露 2023-06-09 12:44:01 +08:00 committed by GitHub
parent c2ad33e1d6
commit 6995305734
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,34 +6,13 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
contents: write
steps: steps:
- uses: actions/checkout@master - uses: actions/checkout@master
name: Check out code name: Check out code
- name: delete photo
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "xxx@websoft9.com"
files=$(ls /)
for file in ${files};do
if [ $file == *.png ];then
echo $file
git rm $file
git commit -m "delete"
break
fi
done
git push -u
- name: update logo - name: update logo
if: contains('Hello world', 'abc') run: |
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "xxx@websoft9.com"
# 获取contentful中所有url # 获取contentful中所有url
entry=$(curl --include \ entry=$(curl --include \
--request GET \ --request GET \
@ -56,18 +35,15 @@ jobs:
echo $url echo $url
file=$(echo appmanage/static/images/${url##*/}) file=$(echo appmanage/static/images/${url##*/})
echo $file echo $file
wget --timeout=3 -q "$url" || continue
if [[ -f ${file} ]];then if [[ -f ${file} ]];then
git rm $file echo "存在此文件,跳过"
git commit -m "delete former logo" continue
fi fi
wget --no-check-certificate -P appmanage/static/images $url echo "执行wget"
wget --timeout=3 -q -P appmanage/static/images "$url"
done done
- name: push logo - name: push logo
if: contains('Hello world', 'abc')
uses: stefanzweifel/git-auto-commit-action@v4 uses: stefanzweifel/git-auto-commit-action@v4
with: with:
commit_message: update logo commit_message: update logo