Update logo.yml

This commit is contained in:
张露 2023-05-29 11:40:19 +08:00 committed by GitHub
parent 2e43b1d097
commit e7819734ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,6 +6,34 @@ on:
jobs:
build:
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:
- uses: actions/checkout@master
name: Check out code
- name: update logo
run: |
files=$(ls appmanage/static/images)
for file in $files;do
app=$(echo ${file%%-*})
echo $app
entry=$(curl --include \
--request GET \
--header 'Authorization: Bearer ${{secrets.CONTENTFUL}}' \
https://api.contentful.com/spaces/wbgvl9e8pqe2/environments/master/entries?content_type=media\&fields.slug=${app} | tail -n 1)
echo $entry
data=$(echo $entry | jq -r '.items[0].fields.imageurl')
if [[ "$data" == null ]];then
continue
fi
url=$(echo $data | sed 's/en-US/en/' | jq -r '.en')
echo $url
wget -P appmanage/static/images $url
done
- name: push logo
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: update logo