Update logo.yml
This commit is contained in:
parent
c2ad33e1d6
commit
6995305734
1 changed files with 6 additions and 30 deletions
36
.github/workflows/logo.yml
vendored
36
.github/workflows/logo.yml
vendored
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue